#!/usr/bin/perl # # navigate.pl # version 19991027 # copyright 1996-1999 by bo larsson # all rights reserved # # bugs or feedback to bliss@seagull.net # for information on how to use, visit http://bliss.seagull.net/ $ten_twenty = ""; # Get the input and strip off all unwanted characters read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); $temp = $buffer; $temp =~ s/\+/ /g; # 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; $ten_twenty =~ s/%([0-9|A-F]{2})/pack(C,hex($1))/eg; } } if ($ten_twenty ne "") { print("location:$ten_twenty\n\n"); } else { print "Content-type: text/plain\n\n"; print "Error: data in wrong format.\n"; print "NAM=$NAM\n"; print "VAL=$VAL\n"; }