I'm trying to get the following frame redirect perl script to parse the following URL correctly:
http://wickedmoon.com/cgi-bin/send.cgi?send=http://cardfountain.com/ecards/4thjuly229902/index.php?enm=1&aid=101711
As it is there seems to be a problem with the = signs, ie '=1&aid=101711' gets cut off the end of the URL when it's parsed through the script.
I need to use this script with other kinds of URLs too, all containing equal signs. Any ideas of what should be added to the script?
Jason
#!/usr/bin/perl
###############################################
## ##
## Frame Redirect v.1 ##
## ----------------------------------------- ##
## by Graeme (webmaster@cgi-scripting.com) ##
## http://www.CGI-Scripting.com ##
## ############################
## This version of Frame redirect is free, if anyone sold it to you ##
## please contact me. Please DO NOT remove any of the copyrights or ##
## links to our site, they keep this CGI free for everyone. ##
## ##
## (c) Copyright 2000 CGI Scripting ##
##################################################
#######################
# Look in the readme.txt file for help setting up this script
$height = "50";
$siteurl = "http://wickedmoon.com";
$framelocation = "http://wickedmoon.com/chooseanothercard.html";
####################### DO NOT EDIT BELOW THIS LINE ######################
@querypairs = split(/&/, $ENV{'QUERY_STRING'});
foreach $querypair (@querypairs) {
($queryname, $queryvalue) = split(/=/, $querypair);
$queryvalue =~ tr/+/ /;
$queryvalue =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$queryvalue =~ s/<([^>]n)*>//g;
if ($QUERY{$queryname}) { $QUERY{$queryname} = $QUERY{$queryname}.",".$queryvalue; }
else { $QUERY{$queryname} = $queryvalue; }
}
if ($QUERY{'send'}=~/http:/) {
print "Content-type: text/htmlnn";
print qq(<HTML>
<HEAD>
<TITLE>$QUERY{'send'}</TITLE>
</HEAD>
<FRAMESET FRAMEBORDER="0" ROWS="$height,*">
<FRAME SRC="$framelocation" SCROLLING="NO">
<FRAME SRC="$QUERY{'send'}">
<NOFRAMES>
<BODY>
Viewing this page requires a browser capable of displaying frames.
</BODY>
</NOFRAMES>
</FRAMESET>
</HTML> );
} else {
print "Location: $siteurlnn";
}
exit;
|