Link to CSU Home Page

Using Counter on ACNS HTTPD Servers

It is very simple to have a counter on a web page served by one of ACNS's servers, www.colostate.edu, holly.colostate.edu, simla.colostate.edu or lamar.colostate.edu. Just add the following to the page:

You are the <!--#exec cgi="/cgi-bin/counter-ord"--> person to view my homepage.

This will produce something like "You are the 12th person to view my homepage."

If you use:

This page has been accessed <!--#exec cgi="/cgi-bin/counter"--> times.

You will see "This page has been accessed 12 times."

The construct <!--#exec cgi="path"--> is a "server side include" (SSI). It looks like an HTML comment, but allows dynamic information to be added to a web page. SSIs allow counters, file sizes, dates and other information to be included in the web page displayed.

You can activate "server side includes" by having your html filename end in .shtml instead of .html or .htm. The .shtml file name extensions indicate to the web server that the file name contains a "server side include" (SSI). When a .shtml file is encountered by the web server it will replace the SSI directive with contents specified by the directive. In the case of counter, the actual value of the counter will be inserted.

NOTE: ACNS servers have been configured to parse .shtml files; you don't have to do any special configuration to your web pages or .htaccess file.

Learn more about Server Side Includes.


This page was last modified 04/07/06.