Page counters are used just like server-side includes. Actually, they are a special case of includes. That means that you can use them only in server-parsed (.xtm) files. The possibility of counting the number of accesses to each page in the service is effected by the presence of the following directive in the httpd.cfg file:
PageCntFile file.name.
The default counter file name is $dir.log. To enable hit counting for files in a given directory, it is enough to place a zero-length file with this name in the directory. Nothing else needs to be done. By the way: a good batchable way to create zero-length file under DOS is to redirect any command that does not produce output to the file name you want to create, e.g. REM > $DIR.LOG. Then you can embed the counts in your HTML pages, using the following syntax:
<!--#pagecnt -->, or
<!--#counter virtual="relative.url" -->
The first form of the include retrieves the hit count for the current document. The second allows you to display hit counts for any file by specifying a pathname relative to the DocumentRoot. You can also count hits for a server-generated directory listing, like in the third example below. In such a case, however, it is necessary to place the counter file specified by PageCntFile in the directory directly above the one that we are interested in.
Examples:
This file has been accessed 3168 times.
The overview file has been accessed 8393 times.
The LIST4 directory
has been accessed
2903 times.
The inculdes used for the examples are:
<!--#pagecnt -->,
<!--#counter file="overview.xtm" -->, and
<!--#counter file="examples/list4/" -->
[Home -
Overview -
Downloading -
Installation -
Configuration -
Implementation notes -
License -
Registering -
Contacts]