this counter'll increment the counter, no matter where are you go the page
from. If you only want that the counter increment for the first time
visitor visit the website, put the code at mainpage file, and check also
the page referrer weather it's a local url or not.
-toto-
Adam writes:
> make a file called counter.php and include this text:
>
> //-------------------------------------counter.php--------------------------
> ---------------//
>
> <?php
> //Simple PHP counter, v0.1. Send comments to [EMAIL PROTECTED]
> if (file_exists('count.inc'))
> {
> $fil = fopen('count.inc', r);
> $dat = fread($fil, filesize('count.inc'));
> echo $dat+1;
> fclose($fil);
> $fil = fopen('count.inc', w);
> fwrite($fil, $dat+1);
> }
> else
> {
> $fil = fopen('count.inc', w);
> fwrite($fil, 1);
> echo '1';
> fclose($fil);
> }
> php?>
>
> //--------------------------------------------------------------------------
> --//
>
>
> then make a file called count.inc and chmod it to 777 so anyone can write to
> it. insert a number into the file.
>
>
> //------------------------------count.inc-----------------------------------
> --//
> some value
--
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]