RE: [PHP] newbie problem: Hit counter.

From: Date: Thu, 15 Mar 2001 16:38:17 +0000
Subject: RE: [PHP] newbie problem: Hit counter.
Groups: php.general 
Request: Send a blank email to php-general+get-44059@lists.php.net to get a copy of this message
Check out : http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1501 http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1697 http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1359 http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1552 http://www.weberdev.com/index.php3?GoTo=get_example.php3?count=1263 Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -----Original Message----- From: Richard Banks [mailto:rbanks@earthsat.com] Sent: Thursday, March 15, 2001 6:17 PM To: Php-General Subject: [PHP] newbie problem: Hit counter. For some reason the number of hits value is not getting replaced [after incrementing] into the original counter file. any help would be appreciated. here is the code : <?php $cntfile = "count"; // The filename where the number of hits is stored, if there isnt one then make it & put the number 0 in it $rs = fopen ($cntfile, "rw"); while (!feof($rs)) { $cntr = fgets($rs, 4096); echo "counter now is $cntr"; echo "<br>"; } fclose ($rs); $wr = fopen ($cntfile, "rw"); $cntr+=1; fputs($wr, $cntr); echo $cntr; fclose($wr); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#44059) next »