No that doesn't work... I dont understand, there's got to be a way to get all the values the user entered in my form into an array.
if ( $ENV{'REQUEST_METHOD'} eq "GET" &&
$ENV{'QUERY_STRING'} ne '') {
$buffer = $ENV{'QUERY_STRING'};
}
elsif ( $ENV{'REQUEST_METHOD'} eq "POST" ) {
read(STDIN,$buffer, $ENV{'CONTENT_LENGTH'});
}
@pairs = split(/&/, $buffer);
foreach $pair (@pairs){
($name, $value) = split(/=/, $pair);
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
if ($FORM{$name}) {
$FORM{$name} = "$FORM{$name}, $value";
}
else {
$FORM{$name} = $value;
}
}
the code above does it without using CGI.pm but I would like to know how to do it with the module instead of writing this all the time.
$vals = $query->param('username');
this gets the value of the user's username...just one line of code. Now if I have a huge form with say 30 input fields, I dont want to have to do that 30 times. So there's got to be a way to get all the user input, and just as simple. Need help...Please help...