For perl generated html pages, I also find it handy to insert the
names in the value field, ie:
name="State"
value="$cgi{State}"
This lets you do error checking for missing fields and redraw the same
page and it will remember what the person had already put in the fields,
so they don't have to retype it.
sub parseit {
if (defined($ENV{CONTENT_LENGTH}) && $ENV{CONTENT_LENGTH} != 0) {
read(STDIN, $content, $ENV{CONTENT_LENGTH});
foreach $pairset (split(/\&/, $content)) {
($key, $val) = split(/=/, $pairset);
$val =~ tr/+/ /;
$val =~ s/%(..)/pack("c", hex($1))/eg;
$cgi{$key} = $val;
}
}
} #end sub
How do I get input from a form?
How do I use cgi forms?
Get the data from forms?