phpQuestioner Posted September 28, 2007 Share Posted September 28, 2007 I have a script that I am using for text file based hit counter. I have been noticing that my the original hit count, in my text file has been fluctuating from the original amount to a very low amount. What is causing this and is there a good way to fix it? <?php $fp = fopen ('textfilesname.txt', 'r'); $now = fgets ($fp); fclose ($fp); if (empty ($_COOKIE['cookiesname'])) { $fp = fopen ('textfilesname.txt', 'w'); $now = $now + 1; fwrite ($fp, $now); setcookie ('cookiesname', 1, time()+315360000); fclose($fp); } ?> Link to comment https://forums.phpfreaks.com/topic/71088-text-files-hit-counter-issuequestion/ Share on other sites More sharing options...
phpQuestioner Posted September 28, 2007 Author Share Posted September 28, 2007 does anyone know why this might be happening and how I can fix it? Link to comment https://forums.phpfreaks.com/topic/71088-text-files-hit-counter-issuequestion/#findComment-357593 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.