Click to See Complete Forum and Search --> : query_string


lhsths
02-05-2003, 03:57 PM
I am trying to extract the values from the query string from the previous cgi who has 2 values in a form ( name, address)

Below is the code that i did, which gives back the query but doesnt seperate them.

i cant see the problem. Can anyone please help me...




#!/bin/bash

echo "Content-type: text/html"
echo
echo "<H3> my $query </H3>"

echo "<H1> Hello World </H1>"
echo "<H3> from $SERVER_NAME </H3>"
echo "<H3> the names is $name </h3>"
echo "<H3> the names is $address </h3>"
echo "<H3> $query = $ENV{$QUERY_STRING}</h3>"
echo "<H3> the query is $QUERY_STRING and $query</h3>"
echo "<p>"

Thanks on advance...

jeffmott
02-05-2003, 04:37 PM
The is no Perl function echo() and you can retrieve CGI parameter values with the CGI module. http://www.perldoc.com/perl5.8.0/lib/CGI.html

Charles
02-05-2003, 05:02 PM
jeffmott,

That's not Perl, it's the BASH shell (http://www.gnu.org/software/bash/bash.html). Take a look at the shebang line.

lhsths
02-05-2003, 06:14 PM
its shells...

i visited the web page but i didnot understand what to do...

some more info please...

Paco Zarabozo
02-07-2003, 06:03 PM
You're using $ENV{$QUERY_STRING}. I don't know if it does change for bash scripts, but...

I think it should be $ENV{QUERY_STRING}, otherwise you're calling $ENV{} since there's no $QUERY_STRING variable predefined.

Paco.