RE: [PHP-WIN] Re: Counter problems!
| From: | Jill dot Ramonsky at Aculab dot com | Date: | Thu, 30 Jan 2003 13:05:17 +0000 |
| Subject: | RE: [PHP-WIN] Re: Counter problems! | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-18225@lists.php.net to get a copy of this message | ||
Try this...
<?
session_start();
if ( ! isset($_SESSION['been_here_before']) )
{
$_SESSION['been_here_before']=TRUE;
$fp=fopen("./counter.txt","r");
$count=fread($fp,5);
fclose($fp);
++$count;
$fp=fopen("./counter.txt","w");
fwrite($fp,$cnt);
fclose($fp);
}
print "Visited: .$count.<BR>";
?>
-----Original Message-----
From: Radovan Radic [mailto:rasho@ving.co.yu]
Sent: Thursday, January 30, 2003 1:06 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] Re: Counter problems!
Yes, but what if you refresh the page?
Or type in the address bar index.php and press enter, i think it will be
increased?
Radovan