Loading...


Ask A Question?

 
 
 
 
 
 
Posted in Computers & Tech / Designing / Web Design and HTML
Author: everydaysushi Total-Replies: 7


Hi all!

I was trying to use (invisible) tables in the design of my site. I have an image that I would like to be placed statically on the right, since it is a point of reference for the rest of my site. I then have a header image that I wanted to be at the top of the page, running up right next to the static image on the right. The lower-left hand corner of the page is the dynamic part, where all the action happens. It's not as small a space as it sounds, don't worry. But my problem is, I can't get the tables to work out the way I want.

Is there a way to FORCE a row height? I know when using frames, you can do like "50,*" meaning the first frame will be 50 pixels height/width (whichever you specify) and the * represents the remaining pixelage. But can you do that with tables? I tried messing around with it but it's just not working out the way I want.

It could be because the image is not aligning to the very TOP of the table. Or the table itself is not aligning to the very TOP of the screen.

If anyone could shed some light on this, I'd greatly appreciate it!! :P

Mon Apr 4, 2005    Reply    New Discussion   
 

Posted in Computers & Tech / Programming / Scripting / PHP
Author: abhiram Total-Replies: 6


I'm working on a project, part of which consists of working with large tables of different kinds. Now, I'm using a page seeking technique which allows you to browse through the records depending on which page you want to see and how many records you want to see on each page.

Now, I need a link (or a form button) on each page which, when clicked, will throw a file to the user for download (the download window should popup immediatly) which will give the part of the table, currently being viewed, in CSV format.

One way I can think of to generate the file is manually, that is, open an empty file in a temp directory and output everything into it using 'fwrite' in the way I want it. Is there any PHP or MySQL function which gives it directly?

But, how do I get the user to download this file? I want it to immediatly open the download window saying "Do you want to download this file" as it does in firefox, rather than take him to another page with a link to the file.

Any ideas?

Thanks.

Sun Mar 12, 2006    Reply    New Discussion   
 
Posted in Computers & Tech / Designing / Web Design and HTML
Author: kraizii88z Total-Replies: 19


"What is" better? I read an interesting article about the benifits of talbes & divs..
http://www.decloak.com/Dev/CSSTables/CSS_Tables_01.aspx
Most prefer tables b/c they're familiar,
but it seems most people are turning their attention to div-style formats..

Sat Sep 25, 2004    Reply    New Discussion   
 

Posted in Astahost / Asta ANSWERS!
Author: (G)mrudula Total-Replies: 0


how to display records from ms access to vb.net in tablat format using adodbVB.NET: MS-Access Interaction Tutorial (Part I)

hi

I am doing a project in vb.Net using ms access as database

but I am unable to display data from access to vb in table form

I am receiving data from aceess using msgbox

actually I don't know any function to display data in table

so Please anybody can help me to solve this

my code is as below 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e AsHandles Button1.Click System.EventArgs)

Dim s As String = Trim(InputBox("Enter Company_ID"))

Dim Temp_rs As New ADODB.Recordset

strconnect = "select * from Company_Master where Company_ID like '%""%' order by Company_ID" + s +

Temp_rs.Open(strconnect, adocon, CursorTypeEnum.AdOpenDynamic, LockTypeEnum.AdLockOptimistic)

Temp_rs.Find("Company_ID=" & s)

MsgBox("Company_ID=" & Temp_rs.Fields("Company_ID").Value & " Company_name=" & Temp_rs.Fields("Company_Name").Value)

End Sub

thank you for your  help in advance

 

-question by mrudula

 


Fri Nov 12, 2010    Reply    New Discussion   
 
Posted in Computers & Tech / Databases
Author: suicide Total-Replies: 0


I am in the middle of creating a little forums system, and all so far is going quite well. However I have come across a small problem;



PHP:



$gather_forums_qry = "SELECT a.frm_id, a.frm_name, a.frm_description,
count(distinct(b.fth_id)) ThreadCount,
count(distinct(c.fpt_id)) PostCount,
a.frm_enabled,
IF( IFNULL( MAX( b.fth_dateposted), 0) > IFNULL( MAX( c.fpt_dateposted), 0),
date_format( IFNULL( MAX( b.fth_dateposted), 0), '%d/%m/%Y %T'),
date_format( IFNULL( MAX( c.fpt_dateposted), 0), '%d/%m/%Y %T')) AS topic_last_post,
d.usr_id AS UserID,
d.usr_name AS UserName
FROM dm_forum a
LEFT JOIN dm_forum_thread b ON ( a.frm_id = b.fth_forumid)
LEFT JOIN dm_forum_post c ON ( b.fth_id = c.fpt_threadid)
LEFT JOIN dm_users d ON ( d.usr_id = IF(IFNULL( b.fth_dateposted, 0) <
IFNULL( c.fpt_dateposted, 0),
b.fth_userid, c.fpt_userid))
WHERE a.frm_enabled = '1'
GROUP BY a.frm_name";






I am trying to get the username of the last user who posted. The above code gets the correct date/time of the last post, it just doesn't get the last username correctly. I know I am missing something, but can't see what.

Fri Sep 10, 2004    Reply    New Discussion   
 
Posted in Computers & Tech / Databases
Author: imjjss Total-Replies: 2


I have no knowledge about sql but I need to run a query. I found an example which get exactly output formate that I want. I plan to borrow this query script but it's very difficult to understand the code, especially, the pd, pa part, What does pd, pa mean in this code?

CODE

$query = <<<QUERY
SELECT DISTINCT(u.ID),
u.user_email,
u.user_nicename,
u.display_name,
pd.value
FROM $wpdb->users u
LEFT
JOIN {$bp->profile->table_name_data} pd
ON u.ID = pd.user_id
LEFT
JOIN (
SELECT DISTINCT( p.post_author ) ID
FROM $wpdb->posts p
WHERE
p.post_type = 'ep_reg'
AND p.post_parent = $postid
$for_admin
) pa
ON u.ID = pa.ID
WHERE
u.user_status = 0
AND pa.ID IS NULL
AND pd.field_id = 1
ORDER BY pd.value ASC
QUERY;

Sat Jun 4, 2011    Reply    New Discussion   
 

Posted in Computers & Tech / Databases
Author: romulo Total-Replies: 1


Interesting Things to Know about MySQL !


Some query results are much more readable when displayed vertically, instead of in the usual horizontal table format. Queries can be displayed vertically by terminating the query with \G instead of a semicolon. For example, longer text values that include newlines often are much easier to read with vertical output:

QUOTE

mysql> SELECT * FROM mails WHERE LENGTH(txt) < 300 LIMIT 300,1\G
*************************** 1. row ***************************
  msg_nro: 3068
    date: 2000-03-01 23:29:50
time_zone: +0200
mail_from: Monty
    reply: monty@no.spam.com
  mail_to: "Thimble Smith" <tim@no.spam.com>
      sbj: UTF-8
      txt: >>>>> "Thimble" == Thimble Smith writes:

Thimble> Hi.  I think this is a good idea.  Is anyone familiar
Thimble> with UTF-8 or Unicode? Otherwise, I'll put this on my
Thimble> TODO list and see what happens.

Yes, please do that.

Regards,
Monty
    file: inbox-jani-1
    hash: 190402944
1 row in set (0.09 sec)



Copied from http://www.advogato.org/person/robhudson/
szupie

Wed Feb 1, 2006    Reply    New Discussion   
 
Posted in Computers & Tech / Programming / Scripting / PHP
Author: Houdini Total-Replies: 4


I see newbies all the time looking for either a login script or after a little querying you find they really would like to have a registration script. The first thing for such a script for a members area would of course be a form and being kind of old fashioned I still like to format my forms with a table but I do use inline CSS to make it a little nicer. I never did like forms that had an asterick * by a field and then a Note: Fields marked with * are required. So what I do instead is add a background color to those areas and then use a CSS background color stating that thise text boxes or whatever are required. Here is a form that I use for a registration.

CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Registration</title>
<meta http-equiv="generator" content="PHP Designer 2006 - BETA" />
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<center><h2>Welcome to the Registration Page.</h2></center>
<div align=justify><font size=-1 color=blue><center><h4>Terms of Service</h4></center>This site is for those that are at least of the age of 18 or older. If you are not at least 18 or older then you must have your parents permission to sign up and they must actually sign up for this page and use theinformation for your account that they provide. With this in mind it is understood by filling out this application that you are the parent or legal guardian of a minor and are signing up for an account. Poronography suggestive photographs or solicitation of prostitution is forbidden on this site. By filling out the form below you are stating that you will abide by the above. If you have lied about your age or identity, your account may be terminated without notice, and possbile prosecution may also result from your actions with the account if granted. Please keep in mind that any content provided by you should be civil in nature and not advocate the overthrow of the United States Goverment or any state therein.</font></div><br /><br />
<table border=1 bordercolor=lightblue width=100%>
<form action='processing2.php' method='post'>
<tr><td><input type='text' name='firstname' style='background:aqua' value='
<?php echo $_POST['firstname']; ?>' /><-Enter First Name</td>
<td><input type='text' name='lastname' style='background:aqua' value='
<?php echo $_POST['lastname']; ?>' /><-Enter Last Name</td>
<td><input type='text' name='username' style='background:aqua' value='
<?php echo $_POST['username']; ?>' /><-Enter preferred username</td></td></tr>
<tr><td><input type='password' name='pass' style='background:aqua' value='
<?php echo $_POST['pass']; ?>' /><-Enter preferred Password</td>
<td><input type='password' name='pass2' style='background:aqua' value='
<?php echo $_POST['pass2']; ?>' /><-Confirm Password</td>
<td><input type='text' name='email' style='background:aqua' value='
<?php echo $_POST['email']; ?>' /><-Enter a valid E-mail</td></tr>
<tr><td><input type='text' name='address' value='
<?php echo $_POST['address']; ?>' /><-Street Address</td>
<td><input type='text' name='city' value='
<?php echo $_POST['city']; ?>' /><-City</td>
<td><input type='text' name='state' value='
<?php echo $_POST['state']; ?>' /><-State</td></tr>
<tr><td><input type='text' name='zip' value='
<?php echo $_POST['zip']; ?>' /><-Zip Code</td>
<td><select name='dobm' style='background:aqua'>
<option value='1'>01</option>
<option value='2'>02</option>
<option value='3'>03</option>
<option value='4'>04</option>
<option value='5'>05</option>
<option value='6'>06</option>
<option value='7'>07</option>
<option value='8'>08</option>
<option value='9'>09</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
</select>
<select name='dobd' style='background:aqua'>
<option value='1'>01</option>
<option value='2'>02</option>
<option value='3'>03</option>
<option value='4'>04</option>
<option value='5'>05</option>
<option value='6'>06</option>
<option value='7'>07</option>
<option value='8'>08</option>
<option value='9'>09</option>
<option value='10'>10</option>
<option value='11'>11</option>
<option value='12'>12</option>
<option value='13'>13</option>
<option value='14'>14</option>
<option value='15'>15</option>
<option value='16'>16</option>
<option value='17'>17</option>
<option value='18'>18</option>
<option value='19'>19</option>
<option value='20'>20</option>
<option value='21'>21</option>
<option value='22'>22</option>
<option value='23'>23</option>
<option value='24'>24</option>
<option value='25'>25</option>
<option value='26'>26</option>
<option value='27'>27</option>
<option value='28'>28</option>
<option value='29'>29</option>
<option value='30'>30</option>
<option value='31'>31</option>
</select>
<select name='doby' style='background:aqua'>
<option value=1930>1930</option>
<option value=1931>1931</option>
<option value=1932>1932</option>
<option value=1933>1933</option>
<option value=1934>1934</option>
<option value=1935>1935</option>
<option value=1936>1936</option>
<option value=1937>1937</option>
<option value=1938>1938</option>
<option value=1939>1939</option>
<option value=1940>1940</option>
<option value=1941>1941</option>
<option value=1942>1942</option>
<option value=1943>1943</option>
<option value=1944>1944</option>
<option value=1945>1945</option>
<option value=1946>1946</option>
<option value=1947>1947</option>
<option value=1948>1948</option>
<option value=1949>1949</option>
<option value=1950>1950</option>
<option value=1951>1951</option>
<option value=1952>1952</option>
<option value=1953>1953</option>
<option value=1954>1954</option>
<option value=1955>1955</option>
<option value=1956>1956</option>
<option value=1957>1957</option>
<option value=1958>1958</option>
<option value=1959>1959</option>
<option value=1960>1960</option>
<option value=1961>1961</option>
<option value=1962>1962</option>
<option value=1963>1963</option>
<option value=1964>1964</option>
<option value=1965>1965</option>
<option value=1966>1966</option>
<option value=1967>1967</option>
<option value=1968>1968</option>
<option value=1969>1969</option>
<option value=1970>1970</option>
<option value=1971>1971</option>
<option value=1972>1972</option>
<option value=1973>1973</option>
<option value=1974>1974</option>
<option value=1975>1975</option>
<option value=1976>1976</option>
<option value=1977>1977</option>
<option value=1978>1978</option>
<option value=1979>1979</option>
<option value=1980>1980</option>
<option value=1981>1981</option>
<option value=1982>1982</option>
<option value=1983>1983</option>
<option value=1984>1984</option>
<option value=1985>1985</option>
<option value=1986>1986</option>
<option value=1987>1987</option>
<option value=1988>1988</option>
<option value=1989>1989</option>
<option value=1990>1990</option>
<option value=1991>1991</option>
<option value=1992>1992</option>
<option value=1993>1993</option>
<option value=1994>1994</option>
<option value=1995>1995</option>
<option value=1996>1996</option>
<option value=1997>1997</option>
<option value=1998>1998</option>
<option value=1999>1999</option>
<option value=2000>2000</option>
</select><-Date of Birth (M-D-Y)
</td>
<td><input type='text' name='occupation' value='
<?php echo $_POST['occupation']; ?>' /><-Occupation</td></tr>
</table><br />
<center>
<span style='background:aqua'>Aqua colored fields are required!</span><br /><br />
</center>
I am over 18 year old or I am the parent or guardian
<input type='radio' name='age' value='yes' />Yes
<input type='radio' name='age' value='no' />No<br />
I agree to the <span style='color:blue'>Terms of Service</span>
as shown above the form.
<input type='radio' name='tos' value='yes' />Yes
<input type='radio' name='tos' value='no' checked />No<br />
<center><input type='submit' name='register' value='Register' style='background;lightcoral'>
</form>
</body>
</html>
It might be a lot of coding but it only need made once and your new users will be spending some time with it. So to avoid data errors and to make date entry into my database easier this is why I use the three drop down select boxes. I prefer to use the PHP only to retain values entered into the various fields in the event on the next page there are errors. Also required but not expressly stated are the two radio button groups for age and the Terms of Service aggrement, which is the first thig checked for in the processing page.

Then of course you will want to process this page when the user has hopefully filled out the thing entirely and with no mistakes like the confirmation of the password. So the very first thing I check for in the next page is the following; pressed submit, checked yes to the age and the Terms of Service.

CODE

if($_POST['register']=='Register' && $_POST['tos']=='yes' && $_POST['age']=='yes'){
Then I check for blank required and generate an error for each one that is to be shown for each error, or if it is correct then I assign a $_SESSION variable to the $_POST value for later use. I start a session at the beginning of the script so I can assign and use $_SESSION variables, and also trim all the $_POST variables with

CODE

$firstname=trim($_POST['firstname']);
$firstname=addslashes($firstname);//in case of apostrophes
$lastname=trim($_POST['lastname']);
$lastname=addslashes($lastname);//in case of apostrophes
...
I also use addslashes with cities because there are some like the one in Idaho that I can't remember nor could I spell, but it does have an apostrophe in it.

I also generate a random number with this script that will be sent out in the email that is sent for the new member to use to activate their acoount. Yes my processing page also send out email and it inserts the information that the user filled out and puts it into a database table named temp, which is purged within 24 hours. One of the fields will have this random number inserted into it as well as all the normal data that will be transferred to the permanent members table.

I said that the first check I made was if the usen hit submit, and the two TOS and age requirements but actually the first thing I check is if the username the new member enters is already in use if it is the file ends with a message that the username they chose is already taken and to hit the back button and try again. Then of course after checking for blank required fields there is a second check for the email validity which is the most you can do short of sending a mail and waiting for a read reciept so I merely use a regex (regular expression) like this.

CODE

if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)){
$error.=("The e-mail address you entered is invalid.<br />");
$num++;
Other than sending an HTML email using the mail() function that is about all that goes on other than the message that shows the information entered by the user (provided everthing else is correct). In this section I give them the option to go ahead and activate from this same script by going to an action.php page which will have another form but this one only asks for the Username Password and the activation code which is presented on the page here. This is optional because the email has a link that goes to another page activation.php the link sent in the email looks like this;

CODE

click on the following link <a href='http://localhost/activate.php?active=$random'>
http://localhost/activate.php?active=$random</a>
also within the email I let those that use AOL know that they might have to copy and paste the activation link into their browser (I think the AOL email client is kind of stupid).

So basically with my registration there are four pages one with the actual form shown above one that checks all the inputs accesses the database and checks to be sure that the username it not already in use by looking at the member table then another page for instant activation which will then check the newly entered data that is in the temp table to be sure they have the correct random number and if so will then insert the users data into the members table and then delete the information that is in the temp table, and an activation page that is accessed with the email link that the processing page created and then do the same as the last mentioned page.

I am sure there are more improvments that can be made to what I already have and ocassionally I look at ways to maybe make some improvements but as it is so far is it satisfactory and does what it is supposed to do. If any body has any ideas for other features or requirements for a registration and processing script then post them in this area. I would like to see them.

Thu Jun 15, 2006    Reply    New Discussion   
 
Posted in Computers & Tech / Designing / Web Design and HTML
Author: soleimanian Total-Replies: 0


Hi Everyone:

I am trying to make music files in "Sibelius" .sib format available to members of my choir. What I would like to do is have a person select the song name and part (tenor1, tenor2, baritone or bass) from a table. This would then furnish three variables to another html file. (songname, songfilename, partname)

This file then uses the "Scorch" plugin from Sibelius to actually display and play the music. The plugin is called from within a special html file.

Currently I just produce multiple copies of this file with the necessary strings filled in manually. This is OK with only a few songs, but is going to get cumbersome as the repertoire expands.


I am very much a novice site builder and have never tried to do anything "interactive" before, other than going to web pages. As a result, I have no experience with anthing like Java or PHP.

Suggestions please?

Fri Sep 2, 2005    Reply    New Discussion   
 
Posted in Computers & Tech / How-To's and Tutorials / Websites and Web Designing
Author: Jaskaran Total-Replies: 7


HTML Coloring System - RGB Values

RGB which stands for Red, Green, Blue. Each can have a value from 0 (none of that color) to 255 (fully that color). The format for RGB is - rgb(RED, GREEN, BLUE), just like the name implies. Below is an example of RGB in use.
Red, Green, and Blue Values:
bgcolor="rgb(255,255,255)" White
bgcolor="rgb(255,0,0)" Red
bgcolor="rgb(0,255,0)" Green
bgcolor="rgb(0,0,255)" Blue

HTML Color Code - Breaking the Code
The following table shows how letters are incorporated into the hexadecimal essentially extending the numbers system to 16 values. Hang in there it all makes sense shortly.

A Real Hexadecimal:
bgcolor="#FFFFFF"

The letter "F" is the maximum amount we can send each color and as you may deduce, this color (#FFFFFF) represents the color white. A formula exists to calculate the numeric equivalent of a hexadecimal.

Hexadecimal Formula:
(15 * 16) + (15) = 255

The formula is real simple. Take the first value (F) or 15 multiply it by 16 and add it to the second value, 15. The value 255 is the maximum allowed for any primary color.

Let's try another one.

Example 2:
bgcolor="#CC7005"

CC(RR - Red)
(12 * 16) + (12) = 204
70(GG - Green)
(7 * 16) + (0) = 112
05(BB - Blue)
(0 * 16) + (5) = 5

If you want to be absolutely sure your colors will not change, use paired hex values for color. Examples: "#0011EE", "#44HHFF", or "#117788". These are called True Colors, since they will stay true in hue from browser to browser.

[note=vizskywalker]Fixed small typo in the title[/note]

Tue Jan 16, 2007    Reply    New Discussion   
 
Posted in Computers & Tech / How-To's and Tutorials / Programming / HTML, XML and other Markup Lan..
Author: miCRoSCoPiC^eaRthLinG Total-Replies: 2


Custom BBCodes for Forums



Hi all,
I came up with this article to share what I learnt of designing Custom BBCodes for various forum softwares while trying to come up with some useful one's for AstaHost. Most of you are by now familiar with the new ones like CONSOLE, NOTE, TABL etc. which I introduced a few days back. So how do these BBCodes work ? And how does the forum softwares parse them.

BBCodes, as you know, usually takes a [ TAG ] Text Stuff [ /TAG ] format. The "Text Stuff" in the textual content on which you want your bbcode to work. In almost 99% of the cases, you HAVE to include the content between a matching pair of TAG & /TAG. Here's what I figured out about the BBCodes of IPB Forum Software after a lot of experimentation. N.B. You've to be a good bit familiar with HTML to be able to create your own BBCode or at least understand how they work.

Step 1
Come up with some logical name for your BBCode that relates to it's job. For example, the CONSOLE BBCode that I created was meant for showing text in a console output format - hence the name. A good idea would be to keep the name of the TAG short & sweet - coz most of us loose interest in using the BBCodes if they're named too long - after all whoever wants to type more BBCodes that the content of their posts. :(

Step 2
THE IPB Software as well as the other common ones (phpBB, SMF, vBulletin etc.) support a common format for BBCodes - so a BBCode written for either of these would logically work for the rest - except in certain cases where you need minor modifications. So how does the BBCode Parser decide which part to display as content and which one to take as the Code? Well quite obviously, the name of the code that we came up in the first step IS the name of the TAG that we're going to enclose in the square brackets [] while using on the forums. So we declare this name, (I'll use my CONSOLE example here) as the TAG. Where do you define this ? All the forum softwares have an Administration Control Panel - where you can perform thousands of administrative stuff on the respective boards. Invariably, here you'll find the option to create custom BBCodes.. Browse to that section and you'll find the option to Create/Edit your codes. See the picture below to spot it on IPB. We won't spend much time discussing the BBCode editors of different forum sw's. Go through the respective docs and find out where you can edit/insert them. Lets get to the real thing rightaway.

bbcodesnapshot2ji.th.jpg

The last textarea in this example, titled Custom BBCode Replacement is the part where your BBCode gets translated to raw HTML. Here's the code I used for my CONSOLE tag.

CODE

<div id="conheader" style="width: 650px; border: solid 1px #000000; background-color: #FFFF80; color: black; border: thin solid; font-family: Tahoma; font-weight: bold; padding-left: 15px; padding-right: 10px; padding-top: 2px; padding-bottom: 2px;">CONSOLE</div><div id="console" style="width: 655px; border: solid 1px #000000; background-color: #000000; color: yellow; border: thin solid; font-family: Tahoma; font-weight: bold; padding-left: 10px; padding-right: 10px; padding-top: 10px; padding-bottom: 10px;">{content}</div>


Take a second look at this jumble of HTML tags. You'll see that the code consists of TWO of the <DIV> or Layer Tags - all those parameters associated with each tag simple specifies the characteristics of those layers (width, height, color, border-color, border-style, font size/weight/color for text inside them etc.). The first <DIV></DIV> tagpair is the one which defines the top header for the console code. It's simply a rectangular box with yellow background and black text and contains the word CONSOLE in it. This is the part of the code which creates it:

CODE

<div id="conheader" style="width: 650px; border: solid 1px #000000; background-color: #FFFF80; color: black; border: thin solid; font-family: Tahoma; font-weight: bold; padding-left: 15px; padding-right: 10px; padding-top: 2px; padding-bottom: 2px;">CONSOLE</div>

Even though it looks cryptic at the first look - it's relatively simple... The parameters/attributes are almost self-explanatory. The width: 650px limits the width of the header to 650pixels. Now this is something you got to be careful about, coz if the width of your DIV is too large, it'll distort your post as well as the whole page out of shape making the right edge leave the screen and go far far beyond. So try to keep this figure within safe limits. The "border", "background-color", "color", "font" etc do exactly what they represent. If you need more info about the various DIV attributes, visit: http://www.w3schools.com/tags/tag_div.asp

The second layer or <DIV> tag is the one which holds the text that you include between the tags. Lets take a closer look at this code again:

CODE

<div id="console" style="width: 655px; border: solid 1px #000000; background-color: #000000; color: yellow; border: thin solid; font-family: Tahoma; font-weight: bold; padding-left: 10px; padding-right: 10px; padding-top: 10px; padding-bottom: 10px;">{content}</div>

As you can see this is almost the same as the first one. I haven't specified any height attribute for this BBCode as I want it to expand vertically to accomodate as many lines of text as you want to include.The text that you include between the tags is passed on as a variable named {content} which you can see right at the end of the code before the ending </div> tag. The whole text is assigned to {content} variable and passed to the HTML parser. This whatever you enclose between the BBCode tags, takes on the style/appearance as specified in the DIV tags.


Still not clear ? Lets take a look at another example. This time it's the HIGHLIGHT BBCode - which can do a little bit extra, in the sense, that it can take the name of the color as an OPTION and pass it to the HTML Parser to give you, your desired color HIGHLIGHT. Here's the Code for it:

CODE

<span style="background-color:{option}">{content}</span>

As you can see this one is real short and sweet. Similar to the textual content, the options that you specify while using a BBCode ( in the form [ TAG = something ] ) is assigned to another variable named {option} which has to be placed properly along with a style attribute. Since we're specifying colors here, the "background-color:{option}" takes the {option} variable and uses it's contents as the name of the color. While using the BBCode, we'll call it as:
HIGHLIGHT=red, for example. This "red" goes into {option} variable, and when it reaches the HTML Parser, the code looks like: <span style="background-color:red">. The {option} part is simply replaced by it's content. Right after that, once again we meet the {content} var, which contains the text to the highlighted.. So something like,
[ HIGHLIGHT=red ]This is Red Text[ /HIGHLIGHT ] will parse as:
<span style="background-color:red">This is Red Text</span>. Get the idea ? Keep in mind that when you create a BBCode that can use an option, you've to declare it so. Go back and take a look at that IPB Picture again. The second last item is a pair of Radio Buttons that enables a BBCode to use the option passed to it. In such a BBCode this must be marked YES.

I'll end this tutorial with another small example - the HR BBCode which is a replacement for the <HR> or Horizontal Rule used in HTML to put a horizontal separator in the page. The code for this is:

CODE

<hr {option}>{content}

The <HR> HTML tag doesn't require an ending /TAG pair - and so it is reflected in the code. Even here I've allowed the code to take an option. If used without any option - it'll draw the standard 3D-Shaded Horizontal Rule, but if an option, like noshade is passed to it, the line will be thick and solid.

Hope this tutorial will give you a basic insight into the workings of BBCode-->HTML and get you started on some cool ones of your own. Waiting for some neat one's from you guys. If you've got some good code ready at hand, feel free to share it with us here (and if it's really good - it might end up being added here and at Trap17 as well)

Have fun :)

Mon Mar 28, 2005    Reply    New Discussion   
 
Posted in Computers & Tech / Hardware Workshop
Author: kevlar557 Total-Replies: 7


I'm trying to format my slave drive, which had linux on it. I have it in my wiondows machine, and I tried to format it. It says that the format was complete, but after it asks for a label in CMD, it says that the format failed. The hard drive is a WD Caviar 30 gig, on IDE 2 slave.

Mon May 30, 2005    Reply    New Discussion   
 
Posted in Computers & Tech / Programming / Scripting / PHP
Author: dungsport Total-Replies: 10


This is quite simple, you could implement it many ways but similar to the following.

Using table to lay out your form but provide 1 more column at the end (This mean 1 more cell for each row). Leave that column empty but formatted and named.

Whenever your javascript code detects any field that needs to be fixed, assign the innerHTML property of the cell of the row contained the field.

Syntax:
<cell name>.innerHTML = "Name could not be empty";

Hope this helpful,

Any further questions, just post them up!!!

Sun Mar 27, 2005    Reply    New Discussion   
 
Posted in Computers & Tech / Programming / Scripting / ASP / ASP.NET
Author: illusion Total-Replies: 5


ummm
Asp.net was based on asp classic and does share the same or very similar syntax for minor things like:

sql statements
server variables
query strings
includes
etc


But even though they have some similarities here and there they are completely different technologies, rather then asp.net being an expansion on asp. Infact the two are so different that asp.net had to have a new format (*.aspx) so the two could run side by side on the same server.
New things asp.net brings to the table:

Asp.net has a new syntax; It is most commonly done in vb.net rather then vbscript
Asp.net has greater language flexibility and can be done with C# J# jscript.net c++.net and more
Asp.net has its own set of elements (<asp:label, <asp:textbox, <asp:button, etc)
Asp.net has new methods for passing variables such as cacheing and viewstate
Asp.net is fully object oriented
Asp.net is compiled at application start for greater performance


Those are some of the most glaring differences in the code. There are plenty of differences between the two as far as how they run, but the focus of this was more on the code.

wht u guys think?

Wed Nov 17, 2004    Reply    New Discussion   
 
Posted in Computers & Tech / How-To's and Tutorials / Programming / PHP
Author: khalilov Total-Replies: 4


A good way to figure out the traffic in your site and what pages need improvement is to keep a record of the visits of every page. In this tutorial, i will show you how to make a simple counter system.

Simple counter:

  1. Keeps track of views of each page.
  2. Shows you an overview of your website's traffic.

Procedure:

  1. First of all create a database and call it Counter, also create a table in that database with 2 fields, 'Page' which as a 20 character (can be more) varcharacter format and 'Count' which has an intermediate integer format.
  2. Insert rows equal to the number of pages on your site, and enter 'Count' as zero.
  3. At every page insert the following code:

CODE

<?php

mysql_connect("localhost","username","password") or die(mysql_error);
mysql_select_db("counter");

$result=mysql_query("SELECT* FROM counter WHERE `Page`='Main page'");
$row=mysql_fetch_array($result);
$i=$row['Count']+1;
mysql_query("UPDATE `counter`.`Counter` SET `Count` = '$i' WHERE CONVERT( `counter`.`Page` USING utf8 ) = 'Main page'");
echo "This page has ".$i." views!";
?>


CODE

mysql_connect("localhost","username","password") or die(mysql_error);
mysql_select_db("counter");

$result=mysql_query("SELECT* FROM counter WHERE `Page`='Main page'");
$row=mysql_fetch_array($result);

This code connects to the database and fetches the array(in this case row) of the viewed page.
Note: change the 'Main page' according to the names you entered in the table, example 'index.php', 'forums.php'.....

CODE

$i=$row['Count']+1;
mysql_query("UPDATE `counter`.`Counter` SET `Count` = '$i' WHERE CONVERT( `counter`.`Page` USING utf8 ) = 'Main page'");

This code increments the number of views of the selected page which was stored in $row['Count'], next the code updates the database with the new count.
Note: again change the 'Main page' according to the names you entered in the table, example 'index.php', 'forums.php'.....

CODE

echo "This page has ".$i." views!";

This is optional, incase you want the page to view how many times it has been visited so far, not necassary. You can change the message into something more attractive.
  • Now for the overview of your website's traffic:
    Note:You can insert this code anywhere.

    CODE

    <?php
    mysql_connect("localhost","username","password") or die(mysql_error);
    mysql_select_db("counter");
    $result=mysql_query("SELECT* FROM counter ");
    $row=mysql_fetch_array($result);
    echo "<table border=1 celspacing=1><tr><th>Page</th><th>Views</th></tr>";
    echo "<tr><td>".$row['Page']."</td><td>".$row['Count']."</td></tr>";
    while($row=mysql_fetch_array($result))
    {echo "<tr><td>".$row['Page']."</td><td>".$row['Count']."</td></tr>";
    }
    echo "</table>";
    ?>


    CODE

    mysql_connect("localhost","username","password") or die(mysql_error);
    mysql_select_db("counter");
    $result=mysql_query("SELECT* FROM counter ");
    $row=mysql_fetch_array($result);

    This gets the FIRST row in the table we made.

    CODE

    echo "<table border=1 celspacing=1><tr><th>Page</th><th>Views</th></tr>";
    echo "<tr><td>".$row['Page']."</td><td>".$row['Count']."</td></tr>";

    This makes a table and views the data of the first page in it.

    CODE

    while($row=mysql_fetch_array($result))
    {echo "<tr><td>".$row['Page']."</td><td>".$row['Count']."</td></tr>";
    }
    echo "</table>";

    Using the while loop here, we can get every row in the table until it ends, when the table ends the mysql_fetch_array function returns false. So, with each value a new row is shown. When the table ends and false is return the loop ends and the table is closed. If you are wondering why i didn't do this in the begining instead of addressing the first row alone, well that is because in some cases the first row will be skipped, according to my experience anyways.

    There you go a simple counter for your website, feel free to use,modify but not sell it ;).

  • Mon Oct 20, 2008    Reply    New Discussion   
     

    Ask a Question (w/o registration) to get Quick Answers!


    astaHost