Re: Web counter question..

From: Date: Mon, 08 Dec 2003 14:51:17 +0000
Subject: Re: Web counter question..
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-31935@lists.php.net to get a copy of this message
Try : <? session_start(); if ( ! isset($_SESSION['count']) ) { $fp=fopen("./counter.txt","r"); $_SESSION['count']=fread($fp,5); fclose($fp); $_SESSION['count']++; $cnt=$_SESSION['count']; $fp=fopen("./counter.txt","w"); fwrite($fp,$cnt); fclose($fp); } $c= $_SESSION['count']; print "You are visitor no : <b>$c</b><BR>"; ?> Jochem James Hatridge wrote:
Hi all.. I just put up my stamp bulletin on line (issue #100!!). I have a problem with it. The counter that I use counts everyone every time they look at the site. I want a better counter, can you all suggest one? It's got to work with html and php only. Thanks, JIM PS Check out my stamp bulletin, link below!


« previous php.db (#31935) next »