PDA

For continued disscussion on this topic : IT Solutions Digital Board



lordhoting
08-17-2000, 09:50 AM
If I wanted the name of an document id e.g.(<input type="text" name="text1" value="testing">) to have the same value in the Perl $variables, how do I do that?

eg <input type=text name=text1 value="testing"> = $text1 has the value of "testing"

big_wreck
08-17-2000, 12:55 PM
Haven't you already answered your own question ?

QueryStrings or POST data are sent in that manner.

When you sumbit a form, if you use something like:


read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}

to decode a POST data send then the form ID's are accessed with $FORM{'$nameOfField'}

Does this help?

lordhoting
08-18-2000, 03:26 AM
So is it "<input type="text" name="text1" value="testing">"
equal to $FORM{'$text1'};?

big_wreck
08-18-2000, 04:38 AM
Yes if you decode the 'post' with the example code

lordhoting
08-18-2000, 09:52 AM
So do I copy the code you first gave me and what else do I have to do?