Find it online at ScriptSearch.com or download directly at WebCounter.zip

If you like my Configurable Graphics Or Text Counter,
please rate it! @ ScriptSearch.com


NAME

counter.pl - Simple, customizable text or graphic web page counter

This counter script does not require SSI, GD or other server side support other than CGI access for the script itself and storage for the digit graphic files if you choose to use them.


SYNOPSIS

Install the script in cgi-bin & chmod 775

Put

        <script language="javascript" src="/cgi-bin/counter.pl"></script>

in your HTML page.

See USAGE for configuration options


INSTALL

Here are the steps to install and use this script

  1. Edit the script and set the configuration options as apropriate

  2. Copy it to your cgi-bin directory on your web server.

  3. Change mode (chmod) to 775.

  4. Install digit images in an images directory if you want to use graphical digits. Be sure to set the imagePath variable to the proper URL for your server


USAGE

To use this script put a line similar to the following into your html source where you want the counter to appear.

        <script language="javascript" src="/cgi-bin/counter.pl"></script>

Two types of parameters to the script are supported. The first is a path which is used to determine what counter to update. This should follow the script name. No path specs are allowed, just a file name. For example

        /MyCounter.cnt would be:
        <script language="javascript" src="/cgi-bin/counter.pl/MyCounter.cnt"></script>

All counter data files will be created in the cgi-bin directory. If no name is specified, the default name is used. The default name is configurable in the config section of the script.

The other type of parameters to the script affect settings of the script. These are all passed as part of the query string (the part after the '?'). Multiple parameters should be seperated with a '&' sign. Parameters that require values should be followed with an equal sign ('=') and the value to be set. Below is a list of parameters, their meaning and an example of usage

PARAMETERS

All parameters are specified in lower case (although values may be in either case, but see the CAVEATS for some warnings)


CAVEATS

There are several 'gotchas' to CGI usage and counter.pl is no different. Make sure you consider each of the following.


EXAMPLES

The following examples may be used to test your installation. The last few will require that you have the appropriate digit files installed.

        <H2>GRAPHICS</H2>
        <p>Index: <script language="javascript" src="/cgi-bin/counter.pl/index.cnt?graphics"></script><br>
        <p>Count: <script language="javascript" src="/cgi-bin/counter.pl/count.cnt?graphics"></script><br>
        <p>Blank: <script language="javascript" src="/cgi-bin/counter.pl?graphics"></script><br>
        <H2>TEXT</H2>
        <p>Index: <script language="javascript" src="/cgi-bin/counter.pl/index.cnt?text&retrieve"></script><br>
        <p>Count: <script language="javascript" src="/cgi-bin/counter.pl/count.cnt?text&retrieve"></script><br>
        <p>Blank: <script language="javascript" src="/cgi-bin/counter.pl?text&retrieve"></script><br>
        <p>TESTS</H2>
        <p>Hidden: <script language="javascript" src="/cgi-bin/counter.pl/index.cnt?text&retrieve&hidden"></script><br>
        <p>Digits = 1: <script language="javascript" src="/cgi-bin/counter.pl/index.cnt?text&retrieve&digits=1"></script><br>
        <p>Digits = 7: <script language="javascript" src="/cgi-bin/counter.pl/index.cnt?text&retrieve&digits=7"></script><br>
        <p>Style = 7seg: <script language="javascript" src="/cgi-bin/counter.pl/index.cnt?text&retrieve&digits=5&style=7SEG"></script><br>
        <p>Style = 57chevy: <script language="javascript" src="/cgi-bin/counter.pl/index.cnt?text&retrieve&digits=5&style=57CHEVY"></script><br>
        <p>Style = realaba: <script language="javascript" src="/cgi-bin/counter.pl/index.cnt?text&retrieve&digits=8&style=REALABA"></script><br>
        <p>Style = cntdwn: <script language="javascript" src="/cgi-bin/counter.pl/index.cnt?text&retrieve&style=CNTDWN"></script><br>


COPYRIGHT

This software is copyright (c) 2002 by James H. Brown and BL Design Solutions, LLC. All rights reserved, world wide.

You may contact the author at james.brown@bldesign.com or james@hmpg.net

This software is free software and may be distributed under the same terms as PERL itself.