I am trying to set a cookie in someones browser and then forward them to another page...this is the code I am using and when you visit the script it does what it is supposed to and forwards you to the correct page...
#!/usr/bin/perl
use CGI;
use CGI qw/:standard/;
use CGI::Cookie;
&cook();
sub cook {
my $in = new CGI;
my $re = $ENV{'HTTP_REFERER'};
my $cookie = $in->cookie ( -name => 'ref',
-value => $re, );
print $in->header ( -cookie => $cookie );
print qq|
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=http://www.audio-grabber.com/domains/">
</head>
<body>
</body>
</html>
|;
}
....then when the person signs up for one of my services on one of my other cgi pages, I want the value of the cookie to be emailed to me with the rest of the registration details, so I have used...
$value=cookie('ref');
open mail...blabla...
print MAIL "Referer: $value";
......but all I see is Referer:
Just a blank space........what have I done wrong?
THANKYOU!
Paul Wilson.
(Dont blame me if I'm wrong!)
#!/usr/bin/perl
use CGI;
use CGI qw/:standard/;
use CGI::Cookie;
&cook();
sub cook {
my $in = new CGI;
my $re = $ENV{'HTTP_REFERER'};
my $cookie = $in->cookie ( -name => 'ref',
-value => $re, );
print $in->header ( -cookie => $cookie );
print qq|
<html>
<head>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=http://www.audio-grabber.com/domains/">
</head>
<body>
</body>
</html>
|;
}
....then when the person signs up for one of my services on one of my other cgi pages, I want the value of the cookie to be emailed to me with the rest of the registration details, so I have used...
$value=cookie('ref');
open mail...blabla...
print MAIL "Referer: $value";
......but all I see is Referer:
Just a blank space........what have I done wrong?
THANKYOU!
Paul Wilson.
(Dont blame me if I'm wrong!)