awarkops 0 Report post Posted December 17, 2005 ok just copy this code to the location you want the counter onPHP Code <?php $file = 'counter.txt'; if(!file_exists($file)) { $handle = fopen($file, 'w'); fwrite($handle, 0); fclose($handle); } $count = file_get_contents($file); $count++; if(is_writable($file)) { $handle = fopen($file, 'w+'); fwrite($handle, $count); fclose($handle); } else { echo 'Could not increment the counter!<br />'; } echo number_format($count).' Hits';?>open notepad and save it as counter.txt then upload it to the director you put the code on the php page a set the permission to 777when adding this code to you page make sure you save you page as name.phpand not as name.htm or name.html or if you have php activation in html u can just save it as htmlim cant remember how to activate php in html if some one can tell me it will help Share this post Link to post Share on other sites
courage 0 Report post Posted January 8, 2006 well i can say its not the easyest, but realy helpful! now people can't cry about couldn't get a hit counter Share this post Link to post Share on other sites
bucksta 0 Report post Posted January 8, 2006 hit counters are easy to make. all you need is some php knowledge and thats all. its harder making a mySQL hit counter but somehow it turns out better. Share this post Link to post Share on other sites
Cerebral Stasis 0 Report post Posted January 8, 2006 I assume this counter actually counts specific hits, so if one sits in a page and refreshes, the counter will continue to go up, right? I, personally, am only interested in counters that actually count unique visitors or at least unique hits. Perhaps you could create a tutorial explaining how to create a counter that works that way.This "tutorial" may be quite useful, but I'm afraid to say it can hardly count as a tutorial, since it doesn't teach one anything, nor does it explain what the individual parts mean or do. Share this post Link to post Share on other sites
BD Photography 0 Report post Posted January 18, 2006 ok just copy this code to the location you want the counter on PHP Code open notepad and save it as counter.txt then upload it to the director you put the code on the php page a set the permission to 777 when adding this code to you page make sure you save you page as name.php and not as name.htm or name.html or if you have php activation in html u can just save it as html im cant remember how to activate php in html if some one can tell me it will help 213642[/snapback] that sounds cool and all. however i jsut dont like other people to see how many other people have visited my site. i like the hit counters taht jsut allow you so see how many people visited your site and at what time of teh day. Share this post Link to post Share on other sites
bucksta 0 Report post Posted January 21, 2006 cool. il try it since i have a blank web site with nothing to put on the main page. a hit counter sounds good. Share this post Link to post Share on other sites
wassie 0 Report post Posted January 22, 2006 omg, then you have a emty website with only a hit counter 0.o Share this post Link to post Share on other sites
Dart-kun 0 Report post Posted January 22, 2006 It's a good tutorial if not a tad short, and pretty simplistic.I recently searching for a hit counter aswell, and ended up finding one that records unique hits each day. So if someone was to Visit my site, it would count 1. No matter how many times they refreash with 24 hours, another hit won't be counted. But after 24 hours, it would raise to 2. It's pretty nice, was just a PHP counter, but it was good. But I ended up losing it, and not being able to find it.Perhaps next time you could make one like this? I'm sure alot of people would like it aswell. Share this post Link to post Share on other sites
apollo 0 Report post Posted January 22, 2006 Hello. I`m new memmber. As courage saied it`s a bit hard for new member, but i`m not begginer with HTMl and PHP, but anyway, it`s not working for me.... Thnx, apo! Share this post Link to post Share on other sites
snlildude87 0 Report post Posted January 22, 2006 Nice code, but why would you make your own when you can have another hit counter done professionally from a site such as statcounter.com that counts unique visitors and shows specific details about each visitor? Share this post Link to post Share on other sites
eee 0 Report post Posted January 25, 2006 thanks on the tutorial ill try and it and see how it works out thanks man... Share this post Link to post Share on other sites
final_fantasy 0 Report post Posted January 27, 2006 thanks man Share this post Link to post Share on other sites
xavierrd 0 Report post Posted January 29, 2006 :)Seems easy and simple, thanks. Share this post Link to post Share on other sites
Kioku 0 Report post Posted February 5, 2006 This is deffinietely better than the "free counter" piece of junk I've been having to use for quite a while. Thanks. Share this post Link to post Share on other sites
zwek 0 Report post Posted February 22, 2006 Nice smple and good tnx Share this post Link to post Share on other sites