Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Annoying Form Problem

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back