This tutorial is simple, but very effective. It will count the unique hits per day and keep a permanent record. I will first explain how it works, and then I will go ahead and give you the code.
First we set up a database and put a chunk of code at the top of every page. This code will catch the users IP and write it to the database along with the date. However, when it goes to write the IP, it first searches for the IP to see if it has already visited the site, but it will only search that day. If the IP has already visited that day, it will not record it again. For example, if IP 123.456 visited on 02/04/00 it will record it, then if that IP visits again on 04/04/00 it will again record it, but if the visit twice on 02/04/00 it will not record the second time.
