This is a simple snippet for a PHP counter that I’ve used in the past and have found quite apt if all you want is a nice clean and basic text counter on your website. It doesn’t report stats or referrals, just the number of times a page has been viewed. It also doesn’t require a database, just PHP support.
So, this is how it’s done.
First, you create a page and call it counternum.txt. Inside if the text file, put the number 1, or whatever number you want to start your counter on. Upload it to your server and them CHMOD (set permissions) to 666.
Then, where you want the counter to be, include this snippet:
counter.txt (opens in a new window–copy and paste the code on your page or in a notepad file)
If you don’t want a long snippet like that, you can always save the snippet to it’s own page, naming it something like counter.php, and then call it up on whatever pages you want it on using an include like:
<?php include (“http://www.yourdomain.com/counter.php”); ?>
Page Views: 106 views



















