Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > CGI query and FORM

Reply
Thread Tools

CGI query and FORM

 
 
Praki
Guest
Posts: n/a
 
      12-13-2007
Hi All,

I m creating the session in the Perl. all the functions are done in a
single file. the operations are performed by the command line
arguments.

for managing the session i m using the CGI. but when i create a CGI
object then all the Input from both POST and GET methods are parsed by
it. i m not able to get the varbale values using FORM. My work is the
enhancemet work so if i change all the FORM varible to CGI query then
its huge task. Is there any way to get the session info from the FORM
Variable...

This comes first of all the lines in my cgi file. so it parse all the
POST and GET methods..
i m not able to the values from FORM varible..

$query = new CGI;
$sid = $query->cookie('CGISESSID') || $query->param('CGISESSID') ||
undef;

after the abouve line
if ($FORM{'lab'} eq "pager") {

plz help me in getting this problem. Is there any way to get session
info from the FORM variable..

Thanks,
Prakash.
 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      12-13-2007

Quoth Praki <(E-Mail Removed)>:
>
> I m creating the session in the Perl. all the functions are done in a
> single file. the operations are performed by the command line
> arguments.
>
> for managing the session i m using the CGI. but when i create a CGI
> object then all the Input from both POST and GET methods are parsed by
> it.


Yes, that's how CGI.pm works.

> i m not able to the values from FORM varible..


If you're expecting a session id in a cookie, and %FORM contains GET and
POST parameters, then it won't be in there.

> $query = new CGI;
> $sid = $query->cookie('CGISESSID') || $query->param('CGISESSID') ||
> undef;


This final || undef is unnecessary.

> after the abouve line
> if ($FORM{'lab'} eq "pager") {


You haven't told us how the %FORM variable is created. Chances are
whatever code you are using is buggy and should be replaced, but I
expect you know that.

If you just want to get cookies, without using the rest of CGI.pm, you
can use CGI::Cookie; something like

use CGI::Cookie;

my %COOKIE = CGI::Cookie->fetch;

my $sid = $COOKIE{CGISESSID} || $FORM{CGISESSID};

Ben

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript for Form (using CGI formmail) that sends user a copy ofthe form data TPK Javascript 1 08-27-2010 12:49 PM
CGI (read multipart form): Accept-Charset encoding error (CGI::InvalidEncoding) Stefan Fischer Ruby 2 02-23-2010 08:17 AM
CGI - How to use upload_hook and query the query string ? roadrunner Perl Misc 1 02-08-2006 01:50 AM
New Service for CGI form submissions - Form-Submit.com ultranate@gmail.com ASP General 0 01-12-2006 08:21 PM
CGI.pm form query sometime return null value YesBalala Perl 1 02-13-2004 06:23 PM



Advertisments