25857Building a Counterhttp://www.phpfreaks.com/tutorials/27/0.phpThe way this counter works is it creates a cookie on the user's computer with their IP and it updates the count according to the status of that cookie. If the cookie is present and the IP in the cookie is the same as the user's current IP then the script knows the user has already been there and it does nothing or if it is present, but has an IP different than the user's current IP or is not present the script knows that the user is either new or was there before, but the cookie has expired so it then updates the count.PHP > Tips and Tutorials > CountersOct 15, 2006
Site counter is one of the earliest script I ever created. Most books and sites on PHP always teach site counter. So not to miss this trend, PhpMagix will also discuss on site counter, but since PhpMagix 'is Magix', I will not only discuss on simple counter, but also on visits counter, and image counter (a la bravenet).
Learn how to make a simple 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.
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.