For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > January 2005 > Catching a query string









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 Catching a query string
Bigus

2005-01-21, 3:55 pm

If I type in my browser a URL to call a test CGI script on my local Apache
server, like this:

http://mymachine/cgi-bin/test.cgi?b=delete

and in the script use the following code:

use CGI;
my $q = new CGI;
my %fd = $q->Vars;
print "Content-type:text/html\n\n";
print $fd{b};

Then nothing is printed out.

I thought the above code was supposed to pull in the QUERY_STRING and break
it down into key/value pairs?

Indeed, if I print out $ENV{QUERY_STRING} it returns this:

QUERY_STRING = b=delete

Any ideas why the CGI module isn't picking it up?

Bigus


Bigus

2005-01-21, 3:55 pm

Actually, forget that - it was a wild goose chase - sorry!

"Bigus" <b1gus AT creationfactor DOT net> wrote in message
news:euWdnS0Dfp1B0GzcRVnyhA@giganews.com...
> If I type in my browser a URL to call a test CGI script on my local Apache
> server, like this:
>
> http://mymachine/cgi-bin/test.cgi?b=delete
>
> and in the script use the following code:
>
> use CGI;
> my $q = new CGI;
> my %fd = $q->Vars;
> print "Content-type:text/html\n\n";
> print $fd{b};
>
> Then nothing is printed out.
>
> I thought the above code was supposed to pull in the QUERY_STRING and
> break it down into key/value pairs?
>
> Indeed, if I print out $ENV{QUERY_STRING} it returns this:
>
> QUERY_STRING = b=delete
>
> Any ideas why the CGI module isn't picking it up?
>
> Bigus
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com