Wolphie Posted February 22, 2008 Share Posted February 22, 2008 I just can't get my head around how this should work. Currently i have a field which updates every time a page is viewed, by any user, so every refresh it will increment by 1. Which isn't efficient enough, considering anybody could create an application to exploit it. (I'm creating a tutorial system by the way) So, i started thinking what if i created a seperate table? But if i done that how would i increment unique page views for each unique IP address? So i then thought, if i created a seperate table, and then insert a new row for each IP address that visits and then count how many rows exist for a specific article. Then that got me thinking, a new row for each unique IP address? What if theirs a 1000 unique IP's a day? Wouldn't that just make things clustered? Any help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/92469-unique-page-views/ Share on other sites More sharing options...
mpharo Posted February 22, 2008 Share Posted February 22, 2008 What I would do is generate a PHP session variable and then insert that into the database along with the IP and Date/Time...So every time a new session is started on your site it is considered a new hit...you then record the IP address and you can get 2 pieces of information from this....You query for unique ip addresses for unique hits for a period of time and then you can query for the session variable to get how many total hits or how many total hits for a unique IP address for a given time...Although the sessions can still be abused, you can filter them out with the unique IP addresses.... Link to comment https://forums.phpfreaks.com/topic/92469-unique-page-views/#findComment-473747 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.