invisible cookie page counter



you know how 'hits' are the number of time the page is viewed regardless of whether its the same person viewing the page or the page being refreshed, is there an easy way using cookies to setup a counter that only counts each ip / host once, cos i would like to add something like this to my site as an invisible code and view it to see how many different people see it. thanks
Jan 15, 2003
Reaction score
Whangarei, New Zealand
Your Mac's Specs
I'd say go with a premade script, you'll get a lot more features. If you get your own domain name sometime in the future, there's a 99% chance you'll get a slew of different statistics scripts. They'll give you graphs, ip addresses, pages most visited/downloaded and tell you what country your visitors come from.

If you want to install a premade one, there are plenty at HotScripts - I suggest you make their PHP section a bookmark - in particular, take a look at BBclone.

If you want to write your own, all you'd need is a simple if() statement. Basically you'd check if the cookie doesn't exist, if so, add one to the hit counter, then print the hit counter out to a file or html page. I can't remember the syntax to set a cookie off the top of my head but I'll post it here later if you like.

Shop Amazon

Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.