##############################################################################
#                              Counter v1.1.1                                #
#                   Graphical Hit Counter for Web Pages                      #
#                                                                            #
#                         Scripts Archive                                    #
#                    https://worldwidemart.com/scripts/                      #
##############################################################################

DESCRIPTION
-----------
Counter is a CGI script that creates a graphical hit counter displaying the
number of visitors to your web page. It generates counter images dynamically
using customizable digit graphics.

FEATURES
--------
* Graphical display with customizable digit images
* No Server Side Includes required
* File locking for concurrent access
* Referer validation for security
* Access logging with timestamps
* Configurable number of digits

REQUIREMENTS
------------
* Unix-based web server with CGI support
* Perl 5.x or higher
* CGI.pm module (usually included with Perl)
* FLY graphics library (optional, for image generation)
* Write permissions for data files

PACKAGE CONTENTS
----------------
counter.pl      - Main counter script
count.txt       - Counter data file (created automatically)
access_log      - Access log file (created automatically)
README          - This documentation file

INSTALLATION
------------
1. Upload counter.pl to your cgi-bin directory
2. Set permissions: chmod 755 counter.pl
3. Create a data directory with write permissions
4. Edit configuration variables in counter.pl
5. Add to your HTML page:
   <img src="/cgi-bin/counter.pl" alt="Hit Counter">

CONFIGURATION
-------------
Edit these variables at the top of counter.pl:

$count_file     - Path to store the count
$log_file       - Path for access log
$digits_dir     - Directory with digit images (0.gif - 9.gif)
$num_digits     - Number of digits to display (e.g., 6 for 000000-999999)
@valid_referers - List of allowed referring domains (leave empty to allow all)

TROUBLESHOOTING
---------------
Problem: Counter shows 0 or doesn't increment
Solution: Check file permissions on count.txt (needs to be writable)

Problem: "Internal Server Error"
Solution: Check script permissions (755), verify Perl path, check error log

Problem: Images don't display
Solution: Verify digits directory path, check image file permissions

SECURITY NOTES
--------------
* Set @valid_referers to prevent counter theft
* Don't place data files in web-accessible directories
* Consider using .htaccess to protect data directory

MODERN ALTERNATIVES
-------------------
For production websites, consider modern analytics solutions:

* Google Analytics (https://analytics.google.com)
* Plausible Analytics (https://plausible.io)
* Matomo (https://matomo.org)
* Simple Analytics (https://simpleanalytics.com)
* GoatCounter (https://www.goatcounter.com)

These provide much more detailed visitor insights than simple hit counters.

LICENSE
-------
This script is distributed under the Artistic License. You may freely use
and modify it for personal and commercial purposes, keeping the copyright
notice intact.

SUPPORT
-------
Documentation: https://worldwidemart.com/scripts/counter.shtml
FAQ: https://worldwidemart.com/scripts/counter.shtml#faq

##############################################################################
