Simple Counters

Last Updated: January 20, 2000


Counters, counters everywhere! It seems that the web counter is just about a ubiquitous as the web itself! Two simple counters (one text and one graphical) are presented in three sections below.

  1. The Server Side Include for the counters
  2. The source code for the counters
  3. Installation instructions


The Server Side Include for the Counters

The HTML source below represents a the server side include necessary to call either the textual or graphical counter CGI.


  <!--#exec cgi="/cgi-bin/library/counter/c4.pl" -->    (textual)

or

  <!--#exec cgi="/cgi-bin/library/counter/c4g.pl" -->   (graphical)

In order for Server Side Includes to work, they must be allowed to execute. This can be done globally with the server configuration files or locally with a file named ".htaccess" (assuming typical installation of NCSA httpd applies). A ".htaccess" file overrides global server configuration for the directory in which it resides. An example of a ".htaccess" file is shown below:

  Options Indexes FollowSymLinks Includes ExecCGI
  AddType text/x-server-parsed-html .html


The Source Code for the Counters

The textual based counter is written by Jonathan Lewis. The graphical based counter is simply a modification of the textual counter- modifications were made by Scott Pierce.

If you are unfamiliar with the CGI standard, or would like to learn more about the Common Gateway Interface, the following URL is an excellent resource:

http://hoohoo.ncsa.uiuc.edu/cgi/


How to Install the Counters


Copyright © 1996, 1997 Last Modified: 20 January 2000. A Little Technology Shoppe, LLC. All rights reserved. All brand names and product names used on these web pages are trademarks, or trade names of their respective holders.