Monday, October 19, 2009

[PHP] Unique Counter

Many websites have IP counters. But alot are lazy and have those refresh ones. So if you look closely, everytime you refresh your page it would simply go up by 1. These are not the true statistics to the site and shouldn't be used for the truth to be told.

Unique counters are alot better, as they count each unique IP address, if its new, it increments the counter by 1. If it's already visited dont.

Many unique IP Counters use Databases, but for those who struggle with db's. Like myself, i made it use a file ;)

Source:http://pastebin.com/f7b8085e7

No comments:

Post a Comment