Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Producing "Most read articles" section

2:37 pm on Aug 10, 2006 (gmt 0)

Full Member

10+ Year Member

joined:Aug 18, 2003
votes: 0

I'm thinking of producing a "Most Read Articles" facility on my website with PHP/Mysql. What's the best way to do this? just update a field in my database each time a user accesses the page?
3:10 pm on Aug 10, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 22, 2001
votes: 0

Maybe you could create a table that's keyed by article ID and a second field is a count of the number of times an article has been read by a browser.

You would probably want to eliminate spiders from this. A handy way to do this would be to have the count incremented by an "image call", where you have an img tag on your page that actually calls a cgi script with a parameter of the article ID, and the script would then increment the counter for that article.