I have this basic counter:
?php
$counterFile = ./counter.txt;
function displayCounter($counterFile) {
global $counted;
$fp = fopen($counterFile, 'rw');
$num= fgets($fp,7);
if (!$counted) {
$num+= 1;
You could be having problems with multiple users, if two visitors come
at the same time file locking problems come into play, one script could
unlink the file at the same time another script tries to open it
resulting in an empty file.
A database would be a better way to do this, but assuming you
the first.
Andrew
- Original Message -
From: Brian V Bonini [EMAIL PROTECTED]
To: PHP Lists [EMAIL PROTECTED]
Sent: Tuesday, February 18, 2003 12:45 AM
Subject: [PHP] Counter has gremlins
I have this basic counter:
?php
$counterFile = ./counter.txt;
function displayCounter
3 matches
Mail list logo