www.digitaldaze.com
S e r v e r   S i d e   I n c l u d e   b a s e d   P a g e   C o u n t e r s

SSI counters have an advantage over normal "img src" based counters because they will always be incremented when your page is loaded, since SSI is processed before the page is returned to the requesting client. "img src" based counters depend on the user to wait for the image to load, to be using a browser that supports image display and they have image display turned on.

1   First you need to create a counter file in the directory where the page to be counted is located. The filename should exactly match the page name except the file extension will be ".count". If you want to count your index.html, create a index.count file, etc. You can include a starting number in your count file, and the counter will begin incrementing from there.

2   Next, you need to call the counter from your HTML source file. The HTML source file must have an extension of either .html or .htm (both lowercase for the SSI to work).

For the text counter, add the following line of code to your HTML file at the point you would like the count to appear:

<!--#exec cgi="/cgi-bin/pub/ssi-tcount.cgi" -->

Sample text counter output: 2834

For the graphical counter, use:

<!--#exec cgi="/cgi-bin/pub/ssi-gcount.cgi" -->

Sample graphical counter output:
Since the counter is called twice, once for text and once for graphics, the text and graphical counter displays on this sample page will never have the same count. Normally you would only call the counter once per page.

Note: Exact spacing of the SSI call is important to be recognized by the server so that it will be executed.

3   Save the file, upload the HTML file and the .count file to your directory and try it out.

 

[Legal Notice]
http://www.digitaldaze.com