Need a Form script


#1

hi can someone post a good working (tested), Request Method/Form phrasing script, or what ever you call those. Try to write a bunch myself but it never worked…

heres what i did…

sub form {
if ($ENV{‘REQUEST_METHOD’} eq “GET”) {
$buffer = $ENV{‘QUERY_STRING’};
} else {
read(STDIN, $buffer, $ENV{‘CONTENT_LENGTH’});
}

@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(“C”, hex($1))/eg;
$value =~ s///g;
$value =~ s/</</g;
$input{$name} = $value;
}
}

I also used a post method.
Well basicly i just need a working one.
Thx!