chrisbot
11-28-2005, 05:53 PM
Have another prob now. Have been working on an online application. This is the prob.
Html file submits 3 variables to pl cgi. There variables are used to generate a page specific to the variables and returns this to the browser.
On that page are a couple of paypal buttons which direct the browser to paypal. What I want is for the browser to return to the page it left, only when this happens it has lost the variables so will not render.
To sort this I made the script write the variables as cookies, and then pick them up again, so as you can re-enter the page. This works seemlessly on Safari, but just tested it on IE and bugger me it wont work. What is up with Microsoft????
#!/usr/bin/perl
if ($ENV{'HTTP_COOKIE'})
{ @cookies=split(/; /,$ENV{'HTTP_COOKIE'}) };
foreach $item(@cookies)
{ ($key,$content) = split(/=/,$item,2);
$fields{$key}=$content;
}
read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$temp);
foreach $item(@pairs)
{
($key,$content)=split(/=/,$item,2);
$content=~tr/+/ /;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
}
# SAVE VARIABLES IN COOKIES
print "Set-Cookie:course = $fields{course} ;
expires = Thu, 01-Dec-2006 00:00:00 GMT\n";
print "Set-Cookie:method = $fields{method} ;
expires = Thu, 01-Dec-2006 00:00:00 GMT\n";
print "Set-Cookie:currency = $fields{currency};
expires = Thu, 01-Dec-2006 00:00:00 GMT\n";
# VARIABLES
$d = $fields{course};
$m = $fields{method};
$c = $fields{currency};
this is my script, what can I do to get IE to behave???
Chris
Html file submits 3 variables to pl cgi. There variables are used to generate a page specific to the variables and returns this to the browser.
On that page are a couple of paypal buttons which direct the browser to paypal. What I want is for the browser to return to the page it left, only when this happens it has lost the variables so will not render.
To sort this I made the script write the variables as cookies, and then pick them up again, so as you can re-enter the page. This works seemlessly on Safari, but just tested it on IE and bugger me it wont work. What is up with Microsoft????
#!/usr/bin/perl
if ($ENV{'HTTP_COOKIE'})
{ @cookies=split(/; /,$ENV{'HTTP_COOKIE'}) };
foreach $item(@cookies)
{ ($key,$content) = split(/=/,$item,2);
$fields{$key}=$content;
}
read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$temp);
foreach $item(@pairs)
{
($key,$content)=split(/=/,$item,2);
$content=~tr/+/ /;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
}
# SAVE VARIABLES IN COOKIES
print "Set-Cookie:course = $fields{course} ;
expires = Thu, 01-Dec-2006 00:00:00 GMT\n";
print "Set-Cookie:method = $fields{method} ;
expires = Thu, 01-Dec-2006 00:00:00 GMT\n";
print "Set-Cookie:currency = $fields{currency};
expires = Thu, 01-Dec-2006 00:00:00 GMT\n";
# VARIABLES
$d = $fields{course};
$m = $fields{method};
$c = $fields{currency};
this is my script, what can I do to get IE to behave???
Chris