home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/perl
- #
- # navigate.pl
- # version 961117
- # copyright 1996 by bo larsson
- # all rights reserved
- #
- # bugs or feedback to bliss@seagull.net
- # for information on how to use, visit http://www.seagull.net/bliss/
- # <FORM METHOD=POST action="http://www.seagull.net/bliss/cgi/navigate.pl">
- # <INPUT TYPE=HIDDEN NAME="Alta Vista" VALUE="http://www.altavista.digital.com/">
- # <INPUT TYPE=HIDDEN NAME="Lycos" VALUE="http://www.lycos.com/">
- # <INPUT TYPE=HIDDEN NAME="Yahoo" VALUE="http://www.yahoo.com/">
- #
- # <TABLE BORDER=1 CELLPADDING=5 ALIGN=CENTER BGCOLOR="#FFFFFF"><TR><TD>
- #
- # <B>Take me to </B>
- # <SELECT NAME="where">
- # <OPTION> Alta Vista
- # <OPTION> Lycos
- # <OPTION> Yahoo
- # </SELECT>
- # <INPUT TYPE="SUBMIT" VALUE="Do It!">
-
- $ten_twenty = "";
-
- # Get the input and strip off all unwanted characters
- read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
- $temp = $buffer;
- $temp =~ s/\+/ /g;
- $temp =~ s/%([0-9|A-F]{2})/pack(C,hex($1))/eg;
-
- # Store the matching name and value pairs
- foreach (split(/&/,$temp))
- {
- ($NAM, $VAL) = split(/=/, $_);
- $DATA{$NAM} = $VAL;
- $valist .= "$NAM=$VAL\n";
- }
-
- # Grab necessary variable
- $where = $DATA{'where'};
-
- foreach (split(/\n/,$valist))
- {
- ($the_place,$the_url) = split(/=/, $_);
- if ($where eq $the_place)
- {
- $ten_twenty = $the_url;
- }
- }
-
- if ($ten_twenty ne "")
- {
- print("location:$ten_twenty\n\n");
- }
- else
- {
- print "Content-type: text/plain\n\n";
- print "You want to go somewhere I don't understand!";
- }
-