How to Put a Hit Counter on Your Page

Want to see how popular your page is? Then you need some way to count how many hits it gets. That is, how many people look at the document.

To add a hit counter to your page, just follow these steps:

  1. Make sure the name of your document ends in .shtml
  2. Go to the place in your HTML document where you want the number to appear and add text such as: You are visitor number:
  3. Add this line at the point in the text where you would like the number to show up:
    <!--#exec cgi="/cgi-bin/counter"-->

Every time someone loads your document, the counter is called. The counter starts at 1 the first time it is called from a page, and goes up by one each additional time it's called. If you rename your file, the counter will start over again at 1. Be careful not to use the counter more than once in the same document, or else it will add one more hit for each extra time you use it!

That's all there is to it! Here's what the counter will look like when you're done:


Hi there! You are visitor number [an error occurred while processing this directive] here.

Back to Making Your Home Page Cooler