WWW FAQ: How can I put an access counter on my home page?

How can I put an access counter on my home page?

First of all, don't. It defeats caching proxy servers, putting more load on your server. It forces your server to run an external program for every page with a counter on it, putting more load on your server. And it advertises your demographics or lack of them to the world.

"Yeah, but I want to know how many people are accessing my page."

Of course you do. Use one of the many statistics tools available to analyze the access log of your web server. Even if you are not the webmaster of your server, your admin will probably give you read-only access to the log files.

Also check out Tim Drozinski's amazing FAQ on counting accesses without the need for CGI programs <URL:http://erau.db.erau.edu/~tjd/log_faq.html>. Most of the techniques recommended there don't abuse the server, which is a Good Thing.

"I want an access counter anyway."

In that case, in addition to Tim Drozinski's page above, consider the index of access counter software at Yahoo (URL is <URL:http://www.yahoo.com/Computers/World_Wide_Web/Programming/Access_Counts/> ). Keep in mind that you must have CGI access at a minimum, and server-side includes must also be turned on unless you are willing to build your entire page with CGI or use a program that generates the access count as an inline image. None of the above approaches are efficient.

World Wide Web FAQ