I have used cgi-lib.pl to parse data from an online form. This form has fields in the following order:
Salutation
Name
Surname
Email
However, when I get the result the order of the fields gets distorted. I get it in the following order:
Surname
Email
Name
Salutation
How can I get cgi-lib.pl to give me the results in the same order as the HTML form?
The code I use is as follows:
Yes, I am from the old school and still use cgi-lib.pl. So please excuse me.
Salutation
Name
Surname
However, when I get the result the order of the fields gets distorted. I get it in the following order:
Surname
Name
Salutation
How can I get cgi-lib.pl to give me the results in the same order as the HTML form?
The code I use is as follows:
Code:
#!/usr/bin/perl
require "cgi-lib.pl";
&ReadParse;
print "Content-type: text/html\n\n";
print <<"PrintTag";
<HTML>
<HEAD>
<TITLE>Testing Form Input</TITLE>
</HEAD>
<BODY>
<TABLE>
PrintTag
foreach $key (keys(%in))
{
print <<"PrintTag";
<TR>
<TD>$key</TD>
<TD>$in{$key}</TD>
</TR>
PrintTag
}
print <<"PrintTag";
</TABLE>
</BODY>
</HTML>
PrintTag
Yes, I am from the old school and still use cgi-lib.pl. So please excuse me.