Everyone that I know of asks one question once they get their site up and running - how can I tell how many people are looking at it? Usually, a CGI-based counter is the answer, but most of those only track total number of hits, and not anything descriptive. Well, DevArticles has an answer to those boring, old CGI scripts (written, of course, in PHP).
Their newest article, Display Users Online Based On Page Viewing, shows you how to create, with PHP and MySQL, a page tracking system, so that you can see which pages are the most popular on your website. Sure, you could just grep out of the access_log file, but that's more trouble than it's worth, especially on the fly. A dynamic table in MySQL can be queried with conditionals that will give you just the info you need.
Of course, they give you all the code so that all you need to do is drop it in and upload the scripts - easy, huh? And, voila - you have a page counter worthy of a king, with the ability to show you how many users are seeing just what you're seeing.




