This probably is not the best way to get form results to XML.
But the challenge I'm having is I would like to be able to capture mulitiple same name keys. Example
Plese enter your birth date
<INPUT TYPE="text" SIZE=30 NAME=Birthdate>
Plese enter your birth date
<INPUT TYPE="text" SIZE=30 NAME=Birthdate>
It's a long form and these same name keys are throughout the form
I made it this far in the code capturing mulitple same names
After decoding %xy:Name=Mark Shortt&Salary=$5555.00&Birthdate=04/18/58&Birthdate=04/19/59
--------------------------------------------------------------------------------After decoding + and &:
<response>
<Salary>$5555.00</Salary>
<Birthdate>04/19/59</Birthdate>
<Name>Mark Shortt</Name>
</response>
# Extracting the + and & and creating key/value pairs
@key_value=split(/&/, $inputstring);
foreach $pair ( @key_value){
($key, $value) = split(/=/, $pair);>/p>
$input{$key} = $value; # Creating a hash
},
# After decoding
print "-" x 80, "
";
print "After decoding + and &:
";
print "<response>
";
while(($key, $value)=each(%input)){
print "<$key>$value</$key>
";
}
print "</response>
"
In reply to CGI form results to XML by spencerr1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |