COPYRIGHT
Text Counter Version 1.00
Copyright 2001 London Perl Mongers, All rights reserved
LICENSE
This script is free software; you are free to redistibute it
and/or modify it under the same terms as Perl itself.
URL
The most up to date version of this script is available from the nms
script archive at .
SUMMARY
Text Counter will keep a record of the number of people who have visited your
web site and display that number. It is intended to be used as a Server Side
Include program.
FILES
In this distribution, you will find three files:
counter.pl - The main perl script.
README - This file. Instructions on how to install and use Text Counter.
MANIFEST - List of files
CONFIGURATION
There are a number of variables that you can change in textcounter.pl which
alter the way that the program works.
$DEBUGGING - This should be set to 1 whilst you are installing
and testing the script. Once the script is live you
should change it to 0. When set to 1, errors will
be output to the browser. This is a security risk and
should not be used when the script is live.
$data_dir - The directory where all of the data files associated with
this program will be stored.
@valid_uri
@invalid_uri - Together these two variables control which URIs on your
server are allowed to use this program to monitor their hits.
The rule is that a URI can use this program if it matches one
of the expressions in @valid_uri _unless_ it matches one of
the expressions in @invalid_uri.
$showlink - If this variable contains a URL then the text counter will
become a link to that URL.
$auto_create - If this variable is true (i.e. 1) then any counters that are
not found will be automatically created. If it is false (i.e.
0) any counters that are not found will trigger an error.
$show_date - If this variable is true then the output will contain the
date that the counter was last reset.
$pad_size - The minimum size of the number displayed. For example, if
your number is 100 and $pad_size is set to 5, then the number
will be displayed as 00100.
$ssi_emit_cgi_headers - This should normally be set to 1. You may need to
change this to 0 if you are seeing stuff output
that you didn't expect as described below.
INSTALLATION
textcounter is installed simply by copying the file textcounter.pl into your
cgi-bin directory. If you don't know where your cgi-bin directory is, then
please ask your system administrator.
You may need to rename textcounter.pl to textcounter.cgi. Again, your system
administrator will know if this is the case.
You will probably need to turn on execute permissions to the file. You can
do this by running the command "chmod +x textcounter.pl" from your command
line. If you don't have command line access to your web server then there
will probably be an equivalent function in your file transfer program.
Then, edit your HTML files and wherever you want to display the counter,
insert the following:
Note: As this is a "Server Side Include" you will need to ensure that your
web server has been configured to support SSI. Also, it's possible that you
may need to rename any files that include SSI calls to give them a different
extension. A common choice is .shtml. Your system administrator will be able
to help you with these details.
Some server software does not expect a program run by a server side include
to output any headers even though it is being run with 'exec cgi' as
above. In these cases you are likely to see something like:
Content-Type: text/html
above your counter. You can stop the output of this header by changing the
configuration variable $ssi_emit_cgi_headers to 0. Some servers that
behave like this have already been identified by the NMS developers and
the program will adjust its own behaviour in those cases, however if you
know of one we have not identified please e-mail the support list below
with the details.
SUPPORT
For support of this script please email: