#!/usr/bin/perl # If necessary, change the above line so that it # references the location of Perl on your server. ################################################## # Perl Counter Script Version 1.0.0 # # Copyright 2000 by Pear-Socam Softworks # # All rights reserved. # # # # Pear-Socam Softworks # # P.O. Box 1391 West Chester, Ohio 45071-1391 # # sales@pear-socam.com www.pear-socam.com # ################################################## # This "Perl Counter Script" is distributed as # # pearware. If you find this script useful, # # please send us something with a pear on it: a # # postcard, a pear-shaped eraser, etc. We're # # not picky. But please no perishables, such # # as actual pears. # # # # You may modify this script for your own needs, # # but please do not distribute modified versions # # without our permission. You may freely # # distribute unaltered versions, as long as it # # is distributed in its entirety, including # # these notices. # # # # This script may not be sold for profit. For # # inclusion as part of a compilation or # # collection of files, please contact us first. # # # # Use of this script is at your own risk. We # # make no warranties or guarantees regarding # # this script or its fitness for any particular # # purpose. By using this script, you agree to # # hold us harmless against any and all claims # # and indemnify us against any liability that # # arise as a result of its use. # ################################################## # CONFIGURATION ################################################## # REPLACE THESE DEFAULT VALUES WITH VALUES FOR # # YOUR SERVER. BE SURE TO ENTER THEM IN THE SAME # # FORMAT AS THE DEFAULT VALUES. # ################################################## # Set $showcount to 0 to display the counter on # # each page being counted. Set it to 1 if you # # do not wish the counter to be displayed. # ################################################## $yourserver = "http://www.yourserver.com/"; $datafolder = "/path/to/data/directory"; $showcount = 0; ################################################## # THIS IS THE END OF THE CONFIGURATION AREA. # ################################################## ################################################## # IMPORTANT NOTES: This script uses two files in # # the specified data folder ($datafolder). One # # is named "count.txt" and the other is named # # "count_temp.txt". Do not delete these files # # and be careful not to run any other scripts or # # CGIs that may create files by the same name in # # the same data folder. # # # # This script must be called from a page that is # # server-parsed (SSI), typically a .shtml file. # ################################################## # INITIALIZE COUNTER # Initializes string for new counters $count = 0; # SECURITY CHECK # Makes sure the script is being run from your server. $origin = $ENV{'HTTP_REFERER'}; if ($origin =~ m#^$yourserver#) { print "Content-type: text/html\n\n"; print "