From: Long Fei <[EMAIL PROTECTED]>
> Can any one tell me if it's possible to pass session information from
> <form action...> I have pages which check session parameter
> '~logged-in' at the begining of all page. And I found that 'submit'
> can not pass session information (from 'action')properly which means I
> am always redirected to 'index.html' page. Below is my test.pl which
> wi ll load page itself if 'update' is submitted, but I will be
> redirected to home page each time.
> #################test.pl######################################### use
> CGI qw(:all); use CGI::Session;
> 
> $cgi=new CGI;
> 
> $session = new CGI::Session ("driver:File", $cgi,
> {Directory=>'c:/tmp/'});
> 
> $sid = $session->id();
> 
> if (($session->param("~logged-in")!= 1) )
> {
>    print "Location: http://localhost:8080/test/index.html\n\n";; 
>    exit;
> }
> 
> print $cgi->header;
> print "<form action=\"./test.pl?CGISESSID=$sid\" method=\"post\">";

Change that to

print qq{<form action="./test.pl" method="post">
<input type="hidden" name="CGISESSID" value="$sid">
};

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to