#!/usr/bin/perl # If necessary, change the above line so that it # references the location of Perl on your server.  ################################################## # Perl Show 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 Show 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. # ################################################## # THESE VALUES SHOULD MATCH THE VALUES ENTERED # # IN THE "count.pl" SCRIPT. # ################################################## $yourserver = "http://www.yourserver.com/"; $datafolder = "/path/to/data/directory"; ################################################## # THIS IS THE END OF THE CONFIGURATION AREA. # ################################################## ################################################## # IMPORTANT NOTES: This script uses one file in # # the specified data folder ($datafolder). It # # is named "count.txt". Do not delete this file # # and be careful not to run any other scripts or # # CGIs that may create a file 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. # ##################################################  # 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 "

PERMISSION DENIED

"; } else {   # OPEN COUNTER FILE  open (COUNT, "<$datafolder/count.txt");  print "Content-type: text/html\n\n";  while (defined($count = )) { chomp($count); @count = split(/\t/, $count); $pageviews = ($count[1] - 1); print ("

Name of Page: ", $count[0], "
"); print ("Current Count: ", $pageviews, "

"); }  close (COUNT);  # CLOSE SECURITY ROUTINE  } # EOF