A counter is an essential part of a site to know how many people are coming to site. Here is an easy way to make a counter. All you need is access to PHP and be able to chmod a directory. We’re going to save the amount of hits in a .dat file, so you don’t even need a mySQL database. First off, you have create a directory and CHMOD it 777 so PHP can write the counter.dat file.
In this tutorial you will need to create two files. The first one is a text file called "counter.txt" that will be used to keep track of the number of visitors. The second file is a php file called "visit.php" that will be used to add to the number of visitors. So create those two files on your website both in the main directory. Open up the "counter.txt" file in notepad or any other text editor that you prefer to use and type in the number zero and save the file.
For this hit counter we are going to use MySQL, PHP and PHP's awesome built in support for sessions. I want to stress the avoidance of cookies for something like this because you are going to be forcing this upon each user's browser and the world of Microsoft users are shifting towards Internet Explorer 6 which has created some great headaches for webmasters that like to use cookies. With PHP's sessions the cookie is stored on the web server and not the user's computer which is a benefit because now the webmaster has control, not the user's finicky web browser.
Joining mailing list will entitle you
to receive occasional emails informing you of news and
updates to the site and any special offers that may be
of interest to you.