V Posted June 16, 2010 Share Posted June 16, 2010 I'm looking to display most popular posts on my site based on unique visitors rather than comments or clicks. My initial idea was to store visitors ip addresses in the database and use that but I read somewhere that storing IP addresses in the DB isn't a good idea because it will slow down your website. What other alternatives do you think are good? Or does anyone know a good tutorial? I can't find anything noob-proof. edit: does anyone know if this can be done with google analytics? Link to comment https://forums.phpfreaks.com/topic/204914-best-solution-for-storing-unique-visitor-ip-addresses/ Share on other sites More sharing options...
Jax2 Posted June 16, 2010 Share Posted June 16, 2010 I'm not sure where you heard that about database slowing down, but I would assume that would depend entirely on how many visitors you have. I have databases that are well into the 10's of thousands of entries and it's not slowed down a bit ... if you write your code well, should be fine. Link to comment https://forums.phpfreaks.com/topic/204914-best-solution-for-storing-unique-visitor-ip-addresses/#findComment-1072999 Share on other sites More sharing options...
mrMarcus Posted June 16, 2010 Share Posted June 16, 2010 Display popular posts based on user id. Best way to do it. IP addresses are constantly changing so you would get inconsistent results. And IP addresses will not slow down a database. Link to comment https://forums.phpfreaks.com/topic/204914-best-solution-for-storing-unique-visitor-ip-addresses/#findComment-1073001 Share on other sites More sharing options...
V Posted June 16, 2010 Author Share Posted June 16, 2010 Thank you for the clarification! @mrMarcus, How do you mean user id? Via sessions? Link to comment https://forums.phpfreaks.com/topic/204914-best-solution-for-storing-unique-visitor-ip-addresses/#findComment-1073084 Share on other sites More sharing options...
mrMarcus Posted June 16, 2010 Share Posted June 16, 2010 Thank you for the clarification! @mrMarcus, How do you mean user id? Via sessions? Can you expand on: display most popular posts on my site based on unique visitors rather than comments or clicks Link to comment https://forums.phpfreaks.com/topic/204914-best-solution-for-storing-unique-visitor-ip-addresses/#findComment-1073169 Share on other sites More sharing options...
V Posted June 16, 2010 Author Share Posted June 16, 2010 Thank you for the clarification! @mrMarcus, How do you mean user id? Via sessions? Can you expand on: display most popular posts on my site based on unique visitors rather than comments or clicks Sure! I want to store IP addresses from all my visitors in my database. I'll have a special table named post_ips which will list all the IP address that visited each post in my site (using a post_id foreign key to relate the posts and ip addresses that visited it) In my website's sidebar for example, I'll display "most viewed" or "most popular posts" by querying unique, non-duplicate IP addresses from each post. Very similar to how google analytics shows you the number of unique visitors to your site. I'm trying to develop the same system and display the posts with the most unique IP count. Link to comment https://forums.phpfreaks.com/topic/204914-best-solution-for-storing-unique-visitor-ip-addresses/#findComment-1073173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.