Webrings and Links
# This script now works with IIS (Internet Infromation Server)
# and PWS (Personal Web Server)!
#
# This script requires that PERL is loaded on your web server
# and that the web server is configured to run PERL scripts as
# CGI scripts.
#
# Configure the script in the User Configuration section below.
#
# Upload this file to your CGI directory on your web server in
# ASCII mode. If you do not know if you have a CGI directory,
# ask your web server administrator.
#
# Chmod this file to 755, if you have Unix.
#
# On unix machines you must create an empty file with the name
# of your log file and then chmod it to 777. Most NT machines
# do this automatically for you.
#
# On unix machines you must create the map data file with the cordinates
# Upload it in Asci and then chmod it to 744.
#
# The script is called by creating a link like this
#
#
#
#
# An exmaple of the data file is
# url|x1|y1|x2|y2
#
# for the url to go to, do not include http://
#
# 0,0 is in the upper left corner of the image
# so in other terms this is your rectangle
# x1,y1.........................x2,y1
# . .
# . .
# x1,y2.........................x2,y2
#
#
#-------------------------------------------------------------
#
#--------------- Variable Definition --------------------------
#
# $filename - the name and location of the data file
#
# $error_url - the url of the file if a click is made were no
# value is defined. Make sure you do not use http:// in the
# url.
#
#-------------------------------------------------------------
#
#------- Start User Configuration ----------------------------
$filename = '/Website/cgi-shl/cgi-scripts/clickimage/map_data.log';
$error_url = 'www.staff.net/cgi-scripts/clickimage/error1.html';
#---End User Configuration -----------------------------------
#**************** DO NOT EDIT PAST THIS LINE *****************#
($x_value, $y_value) = split(/,/,$ENV{QUERY_STRING});
$match='no';
open (DATA, "$filename");
while ()
{
($url, $x1, $y1, $x2, $y2) = split(/\|/,$_);
if ($x_value > $x1 && $x_value < $x2 && $y_value > $y1 && $y_value < $y2 )
{
$match='yes';
last;
}
}
close (DATA);
if ($match eq 'yes')
{
print "HTTP/1.0 302 Temporary Redirection\r\n" if $ENV{PERLXS} eq "PerlIS";
print "Content-type: text/html\n";
print ("Location: http://$url\n\n");
exit;
}
else
{
print "HTTP/1.0 302 Temporary Redirection\r\n" if $ENV{PERLXS} eq "PerlIS";
print "Content-type: text/html\n";
print ("Location: http://$error_url\n\n");
exit;
}
exit;