Dynadot โ€” .com Registration $8.99

Annoying Form Problem

Spaceship Spaceship
Watch

buddybuddha

Established Member
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.

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?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
Never mind I was printing my html headers before I read the post data. Didn't know that causes an error, but apparently, it does.
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Appraise.net
Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back