I have a problem with a script which I want to read a previously set cookie when a form is submitted. The aim is to check the value of the cookie, then process the form depending on the result.
The read cookie routine (example from script below) seems to work only when there is no form parse routine called elsewhere in the script.
Is it possible to do these 2 things together?
Any ideas greatly appreciated...
#####
use CGI;
&ReadCookie;
sub ReadCookie {
$query = new CGI;
print $query -> header;
print "<HTML><head><title>Cookies</title></head><body>";
print "<table border=\"1\">\n";
print "<tr><th>name</th><th>value</th></tr>\n";
foreach my $cookie_name ($query->cookie()){
print "<tr><td>Name: $cookie_name</td>\n";
print "<td>Value: ",$query->cookie
($cookie_name),"</td></tr>\n";
}
print "</table>";
}
#####
Thanks.
The read cookie routine (example from script below) seems to work only when there is no form parse routine called elsewhere in the script.
Is it possible to do these 2 things together?
Any ideas greatly appreciated...
#####
use CGI;
&ReadCookie;
sub ReadCookie {
$query = new CGI;
print $query -> header;
print "<HTML><head><title>Cookies</title></head><body>";
print "<table border=\"1\">\n";
print "<tr><th>name</th><th>value</th></tr>\n";
foreach my $cookie_name ($query->cookie()){
print "<tr><td>Name: $cookie_name</td>\n";
print "<td>Value: ",$query->cookie
($cookie_name),"</td></tr>\n";
}
print "</table>";
}
#####
Thanks.