Progress!! now I understand what the 'QUERY_STRING' is!
and a little
foreach(@key = keys(%ENV))
{
print "$_: $ENV{$_}<br>\n";
}
Gave me a whole lot of stuff!!
Pete, thanks for the kick start. And major thanks for calrifying the param()
thing!
Jean-Matthieu, Andrew, thank you for the responses.
Merlyn, thanks for the % and $ distinction. I wrote something useful with
that! (see above)
-----Original Message-----
From: Pete Emerson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 11:23 AM
To: [EMAIL PROTECTED]
Subject: Re: the ENV command? parameter?
Brian,
If you're looking for info about CGI, here's a very simple short CGI Perl
script that will help answer your question. I'll put my comments at the end.
#!/usr/bin/perl
use CGI qw(:standard);
if (!param()) {
print header;
print start_html;
print "<FORM>\n";
print "<INPUT TYPE=RADIO NAME='color' VALUE='red'>Red<BR>\n";
print "<INPUT TYPE=RADIO NAME='color' VALUE='blue'>Blue<BR>\n";
print "<INPUT TYPE=HIDDEN NAME='hidden' VALUE='hello'>\n";
print "<INPUT TYPE=SUBMIT>\n";
print "</FORM>\n";
print end_html;
} else {
print header;
print start_html;
print "$ENV{'QUERY_STRING'}<BR>\n";
print end_html;
}
If no parameters are submitted, print out the header and starting html info,
and then show this little form which has two radio buttons, a hidden piece
of
information, and a submit button. When you click on the submit button, the
form submits the data to itself, and we run the else portion of the program.
The result looked like this for me:
color=red&hidden=hello
The $ENV{'QUERY_STRING'} is all of the submitted pieces of information all
at
once, in pairs, with an & separating the pairs. To pull out individual pairs
with the CGI module, you can do:
$color=param('color');
$hidden=param('hidden');
I hope this helps.
Pete