Hi There,
I downloaded this page counter just to observe the traffic on certain pages.
Here is the code :
<?php
error_reporting(0);
$counter_name = "inc/teller/" .$StatsYear .$TellerFile;
if (file_exists($counter_name))
{
$fil = fopen($counter_name, r);
$dat = fread($fil, filesize($counter_name));
fclose($fil);
$fil = fopen($counter_name, w);
fwrite($fil, $dat+1);
}
else
{
$fil = fopen($counter_name, w);
fwrite($fil, 1);
fclose($fil);
}
?>
Now it sometimes goes back to 0, my guess is that perhaps two people at once cause the file to update and it has a fit?
It used to just make the file go blanc while it needs at least a 0 in there but I fixed that part of it with the latest version.
I added the no error code as when the file goes blanc, it used to output the error and that was annoying to say the least.
How can I stop this from happening? The counter was up to 900 something last time I looked, now it says 60 and I did not place it back to 0.
This all within the last two days.
Cheers