I am making a visitor counting system for user posts to show the most viewed posts on homepage. I have a visitor counting system now but all it registers a view at every page refresh. I cannot use Google Analytics.
What I need is a visitor counter which only counts the unique visitors. In my case, unique means one person can only view a post in a day? Even a week might work, I think. Can you write that php code in here? You can give me a link to some good tutorials too if you like too.
This is what the code needs to do (or equivalent):
- Once the page loads, check if the visitor is new or old(I have no idea how to do it .. )
- If he is old, ignore him
- If he is new, in mysql, views = views + 1