No problem.

Initialize the counter before your loop, like so:  $counter = 1;
In the loop, print out the value of the counter and increment it by 1: echo 
$counter++;

The "++" added to counter instructs PHP to increase the value by 1 AFTER 
the operation and is a shorthand way of saying
         echo $counter;
         $counter = $counter + 1;

If the second way is clearer to you, and you feel more comfortable with it, 
do it that way.

It will be well worth your time visiting www.thickbook.com and doing Julie 
Meloni's tutorials. She covers a lot of basic principles very clearly. You 
can also pick up a LOT of useful information on PHP at phpessentials, 
devshed, zend.com and so forth.

Have fun - Miles

At 11:00 AM 3/12/01 -0800, Gavin Tong wrote:
>Miles, thank you for your prompt reply and suggestion.  My problem is that I
>am an absolute beginer, not only to php, but to programing in general.  I
>understand the logic of the counter but my attempts to add it into the
>script have failed.  Any direction you could give me would be greatly
>appreciated.
>Thanks again,
>Gavin Tong


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to