[PHP] Counter has gremlins

2003-02-17 Thread Brian V Bonini
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;

Re: [PHP] Counter has gremlins

2003-02-17 Thread Jason Sheets
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

Re: [PHP] Counter has gremlins

2003-02-17 Thread Andrew Brampton
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