#!/usr/local/bin/perl # Change the line abve to match the path to perl on your server #========================================= # Copyright July 2002 All Rights Reserved # By Brent Maurer. #========================================= # DON'T CHANGE ANYTHING AFTER THIS LINE #========================================= # INSTRUCTIONS FOR USE # See accompanying README.TXT file. use CGI; $Arguments = $ENV{'QUERY_STRING'}; $LOCK_EX = 2; $LOCK_UN = 8; #print "Content-type: text/html\n\n"; print "Content-type: application/x-javascript\n"; print "Pragma: no-cache\n\n"; @ab = split(/=/, $Arguments); $value=0; unless (open(A, $ab[1])) { print "document.write(\'err\')\;"; die ("File not found $ab[1]"); } close(A); open(A, "<$ab[1]"); $value = ; chomp($value); $value += 1; if ($value < $ab[0]) { $value = $ab[0]; } print "document.write(\'$value\')\;"; close(A); open(A, ">$ab[1]"); flock (A, $LOCK_EX); print A $value; flock (A, $LOCK_UN); close(A);