#!/usr/bin/perl # # Redirect CGI # *Version 2.3.1.1 # *Ranson Johnson # *Last Modified: 6/7/96 # This was developed to be able to log users leaveing my site via # the links page. # The script thanks the user for visiting my page, then redirects them # to the URL they selected. (4 sec. delay) ** selectable below # This uses the HTML 3 #. #Tennessee Pewter Co.
#The artisans at Tennessee Pewter try to present some hand-crafted alternatives to mass-produced #items. The quality of feeling in our products is the focus here. # #URL of site # #Title of site # # asign a number to the link #
# ############################################################################# #################### Things you will want to change ###################### $delay = '4'; # IN SECONDS $thanks = 'Thank you for visiting My Page'; ### if REDIR = 0 $come_again = 'Come again often to view the additions to the Scripts Page'; ########### Set the redirection (1) for sending the user to another URL, ########### and log the stats on the user, but no thank you screen #REDIRECTION OPTION #**Select a thank you screen (0) - or no thank you screen (1) $REDIR = 0; $ADDRESS = 'http://www.rlaj.com/scripts'; # address for redirect (1) $USELOG = 1; # If you do not want to use the log, set to '0' $redir_log = 'redir.log'; ################ YOU SHOULDN'T HAVE TO CHANGE ANYTHING BELOW ############# # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s///g; $FORM{$name} = $value; } ######################################################################### # Redirection Option if ($REDIR eq '1') { print "Location: $ADDRESS\n\n"; } ######################################################################### # Send User to Link if ($REDIR eq '0') { # Print Beginning of HTML print "Content-Type: text/html\n\n"; print "\n"; print "$FORM{'TITLE'}\n"; print "\n"; print "
Make your own free website on Tripod.com
\n"; print "

$thanks

\n"; print "$come_again



\n"; print "

Your off to visit - \n"; print "$FORM{'TITLE'}\n"; print "\n"; } #################### Log the page the user is going to #################### $PRINT = "Content-type:\ text/plain\n\n "; $shortdate = `date +"%D %T"`; chop ($shortdate); if ($USELOG eq '1') { $PRINT; open (MAINLOG, ">>$redir_log"); print MAINLOG "\n"; print MAINLOG "Link: $FORM{'LINK'}\n"; print MAINLOG "Time: $shortdate\n"; close (MAINLOG); } exit;