Office of Information Technology

Setting up a counter

To add a counter to your web page, use HTML as below:

<img src=/cgi-bin/nph-count?width=5&link=/path/to/page.html>

Change /path/to/page.html to the path to your document.
This will show a 5 digit counter, and store the count under the link argument.
The syntax for calling the counter cgi is:
<img src=/cgi-bin/nph-count?[arg=value]>

or if your pages are on life.illinois.edu, then use the full URL for nph-count:
<img src=http://www.life.illinois.edu/cgi-bin/nph-count?[arg=value]>

The arguments are:

  • width=number
    Specifies the number of digits in the counter.
  • link=path to the page on which the counter is located
    The link-argument is used to keep track of a certain counter. It should be unique for each counter.
    A good choice is the URL of the page on which the counter image is located.
  • increase=number; default 1
    Specifies the number by which the counter should be increased. This can be used to check how many times a certain page was visited without increasing the counter. In that case specify
    increase=0.
    Resetting a certain counter is also possible this way by specifying a negative number here.
  • show=NO
    In case you would like to keep track of the number of accesses to a certain page without showing the counter image, specify the above argument.

Return to Frequently Asked Questions
help@life.illinois.edu