Here's my HTML file:
<html>
<head>Test</head>
<body>
<form name="feedback" method="post" action="cgi-bin/feedback.pl">
<p><font size="5"> <font size="4">Your Name:
<input name="name" type="text" id="name">* </font></font></p>
<p> <font size="4">
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Submit2" value="Reset">
</font></p>
</form>
</body>
</html>
Here's a small perl script that uses the environment variable CONTENT_LENGTH. However, it finds REQUEST_METHOD.
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN, $FormData, $ENV{'CONTENT_LENGTH'});
# Get the name and value for each form input:
@pairs = split(/&/, $FormData);
# Then for each name/value pair....
foreach $pair (@pairs) {
# Separate the name and value:
($name, $value) = split(/=/, $pair);
# Convert + signs to spaces:
$value =~ tr/+/ /;
# Convert hex pairs (%HH) to ASCII characters:
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
# Store values in a hash called %FORM:
$FORM{$name} = $value;
}
}
Any ideas what I might be doing wrong?