#!/usr/bin/perl # Name: jump.off.cgi # # Version: 1.0 # # Last Modified: 7-30-96 # # Copyright Information: This script was written by Jeff Mackintosh # (jmackintosh@beonthenet.com, http://www.beonthenet.com) # feel free to use this code in any way that you wish, just let me # know when. I like to see my creations working in the cyberworld. # # Description: This program takes input from jump.list.pl and sends # the user to the appropriate page. # # Installation: Store this script in the same directory as jump.list.pl and # make sure that its attributes are set for 755. # # Charge: There is no charge for this program, except to help two others # learn to use the 'net as it was intended. # # 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; $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # Stop people from using subshells to execute commands # Not a big deal when using sendmail, but very important # when using UCB mail (aka mailx). # $value =~ s/~!/ ~!/g; # Uncomment for debugging purposes # print "Setting $name to $value
"; $FORM{$name} = $value; } # Now send the people on their merry way! print "Content-type: text/html\n"; print "Location: $FORM{'LOCATION'}\n\n";