cragllo 0 Report post Posted December 6, 2004 All you do is copy this code into the page you want to display it on. <?php$counterfile = "counter.txt";$counter = file("$counterfile");$c = $counter[0];if (strlen($c) == 0){$c=0;}$c=$c+1;$a = fopen("$counterfile", "w");fwrite($a, $counter = "");fputs($a, $c);fclose($a);echo ("$c");?>Make a file called 'counter.txt' in the same directory as the page the code is on.Remember to CHMOD your txt file to 666. (change the permissions to 666) Share this post Link to post Share on other sites
triplebtalk 0 Report post Posted January 2, 2009 Wow thats even better than the other tutorial I read on this site. Thanks for making such a simple PHP counter. You could explain what each function does, but otherwise, great job. Share this post Link to post Share on other sites
contactskn 2 Report post Posted January 3, 2009 Dear friend its much more easier than the previous one so it will be helpfull for many out here and definitely be tried by many. Thank you very much such a good code set.? Share this post Link to post Share on other sites
webishqiptar 0 Report post Posted May 2, 2009 yes very simple hit counter, but you cannot integrate it on every page. You need a new script for every directory, and I like hit counters who are integrated with databases. Share this post Link to post Share on other sites