Home > Archive > PERL CGI Beginners > September 2004 > cant read cookie values from popup window....... plzz help me........
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
cant read cookie values from popup window....... plzz help me........
|
|
| Manoj Tr 2004-09-22, 3:55 pm |
|
Hai all,
I use the strict paragma and and declared variable as correctly. After compilation there is no error and this time i
cant read the cookie from the second window (pop up window generated by javascript). I request you to please point out the error if any one faced this problem.
i send thecode that i corrected as follows.
Thanks in Advance...
Regards
Manoj
****************************************
****************************************
**********************
#!/usr/bin/perl
use strict;
use CGI;
our $output = new CGI("");
our $input = new CGI;
our $cookie;
print "Content-type: text/html\r\n\r\n";
if ($input->param('cmd') eq 'test2') {&test2;}
else { &test; }
sub test {
$cookie = $output->cookie(-name => 'uid', -value => u100', -expires => '+1d');
$output->header(-expires => '-1d',-cookie =>$cookie);
print "<html>\n";
print "<head>\n";
print $cookie." ssssssssssssssssssssssf \n";
print "<script language=\"Javascript\">\n";
print "function spawn(page) {";
print "window.open(page,\"\",\" left=5,top=5,height=480,width=600,status
=yes,toolbar=no,menubar=no,scrollbars=ye
s\");}
</script>\n";
print "</head>\n";
print "<body lang=en-US style=\"background-color: rgb(153,204, 255);\"\n";
print " <h3>MENU</h3>\n";
print "<p><a href=\"#\" Onclick='spawn(\"/testcookie.pl?cmd=test2\")'>OnlineTest </a></p>";
print "</body></html>\n";
}
sub test2 {
print "<html>\n";
print "<head>\n";
print "</head>\n";
print "<body lang=en-US style=\"background-color: rgb(153, 204, 255);\">\n";
print $cookie." dffffffffffffffffffffff \n";
print " <h3>MENU</h3>\n";
print "<p><a href=\"#\"
Online Test </a></p>";
print "</body></html>\n";
}
****************************************
****************************************
*********************
--
________________________________________
______
Check out the latest SMS services @ http://www.linuxmail.org
This allows you to send and receive SMS through your mailbox.
Powered by Outblaze
| |
| Bill Jones 2004-09-22, 3:55 pm |
|
--- manoj tr <manojtr@linuxmail.org> wrote:
> i send thecode that i corrected as follows.
> $cookie = $output->cookie(-name => 'uid', -value => u100', -expires
> => '+1d');
Well, for one, your quotes are unba;nced starting at the above line.
Also, I would use -
use strict;
use warnings;
use diagnostics;
HTH;
-Sx-
=====
-Sx-
s ing employment: http://youve-reached-the.endoftheinternet.org/
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
|
|
|
|
|