|
Title: |
Dimke's Universal Counter Project |
|
Picture: |
 |
|
Explanation: |
This counter is based on Apache's Server Side Includes, "SSI" function, which allows
to enbed dynamically generated data into your web pages.
Dimke's Universal Counter Project consists of two files:
counters.txt, which stores all your different counter values, and counter.pl, which
searches through counters.txt when invoked, increases the certain counter value when
found and formats and prints it at the desired location on the page.
|
|
How it works: |
On any web page you want to have a page counter on it you just have to write the
SSI command, see "How to use" section, for running a cgi script with a parameter
that corresponds to the counter value for this counter.
So, when counter.pl is invoked passing a parameter to it by proceding a "?counter_name"
after it, counter.pl will search through its counter database and increase the desired
counter value when found.
Then the new counter value is written to the page as white text on black ground, as
known from other counters.
The main advantage of this package is, that this solution is fast, slim, and does
only need one program / script file for any number of counters.
|
|
How to use: |
Unpack the zip file into an empty directory and copy both files, counter.pl as well as
counters.txt into your local cgi directory, i.e. mostly ~/cgi-bin.
Be sure that counter.pl is executable by Perl and counters.txt can be read as well
as written by Perl.
Within counters.txt there is always one line per virtual counter.
The syntax is Counter_name=Counter_Value. This means, you can always set or modify
the value of any of your counters using any text editor of your choice.
For integrating the counter into your pages you need Server Side Includes, "SSI".
The syntax is
<!--#include virtual="/cgi-bin/counter.pl?Counter_Name=HTTP401&Minimum_Width=4" -->,
whereas "Counter_Name=HTTP401" (example) is the name of the virtual counter, corresponding to the
page to serve by this counter, e.g. the error page that will be sent by the server every time
the authentication fails, and "Minimum_Width=4" will force the counter to fill the remaining
space leftside of the number with leading "0"s if the number has less than 4 digits.
|
|
Download Source: |
counter.zip
|
|
|