- Impact
- 2
So I'm getting a really agrivating problem here with my perl codes.
I got the following form being sent to a perl program.
and in the Document.pl I have the following test script:
Comes up blank everytime. Anyone have an explanation?
I got the following form being sent to a perl program.
Code:
<form method="POST" action="/Version3/Email/Document.pl" name="myForm">
<center><br>
<font size=2>Username:<br></font>
<input type=text name=a size=30 class=text><br>
<font size=2>Password:<br></font>
<input type=password size=30 name=b class=text><br>
<input type="hidden" name="mod" value="true">
<input type="submit" class="button" name="LOGIN" value="Login">
</form>
and in the Document.pl I have the following test script:
Code:
# Read the standard input (sent by the form):
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;
}
print $FORM{'a'};
Comes up blank everytime. Anyone have an explanation?








