Ad click-through redirection
#!/usr/local/bin/perl
#
# Ad Click-Through Redirection
# Ken Wronkiewicz
#
# Version 1.00 - Inital release - Ken Wronkiewicz
# Version 1.01 - Cosmetic Changes - Ken Wronkiewicz
# Version 1.02 - Little changes - Ken Wronkiewicz
# Version 1.03 - Fixed small bug - Ken Wronkiewicz
#
# Docs on http://www.wirewd.com/wh/cgi.html
#
# Set up the variables
#
$Rhost = $ENV{'REMOTE_HOST'};
$Rip = $ENV{'REMOTE_ADDR'};
#
# Configuration Settings
#
$Redirect = 'http://www.wirewd.com/wh/'; # URL to redirect to
$Logfile = './log.log'; # File to log to
$Id = 'AD#1'; # ID to use in the logfile.
#
# Log the access
#
# Open the logfile
open(F1, ">>$Logfile");
# Grab the time
($Ssec,$Min,$Hour,$Mday,$Mon,$Year,$Wday,$Yday,$IsDst) = localtime(time);
# Enter it into the logfile
print(F1 "$Rhost [$Rip] - $Mday/$Mon/$Year $Hour:$Min - $Id
");
# Close the logfile
close(F1);
# Redirect the user
print("location:$Redirect
");