Ok. Here is the scenario:
Passing a list with multiple selections. How do I post all of those values on the next form? For example: I have a list with multiple document names selected, and when this is passed to the next script the only variable retained is the last doc in the list because the data is being overwritten for the variable.
Sorry if that is not clear, kind of a weird problem to begin with...Almost forgot the important parts.
I am using perl and I am using the POST method for passing data between scripts.version2,
Is it possible to provide a url to your script, to see what your trying to do?
Regards,Actually, its an intranet project. Let me see if I can word it a little better.
Using the code below:
read(STDIN,$submit,$ENV{'CONTENT_LENGTH'});
foreach $pair (split('&', $submit))
{
if ($pair =~ /(.*)=(.*)/)
{
($key,$value) = ($1,$2); # get key, value.
$value =~ s/\+/ /g; # substitute spaces for + signs.
$value =~ s/%(..)/pack('c',hex($1))/eg;
$inputs{$key} .= "\0" if (defined($inputs{$key}));
$inputs{$key} = $value; # Create Associative Array.
}
}
I am losing all of my lists that have multiple selected items because that key/value pair is being overwritten. I just cant find the reason why this is happening. Thanks in advance.Try modifying your parse code a little and see if it helps:
if (defined($inputs{$key})) {
$inputs{$key} .= "\0";
}
$inputs{$key} .= $value; # Create Associative array
Regards,
KevinThanks Kevin. Finally got it...
Passing a list with multiple selections. How do I post all of those values on the next form? For example: I have a list with multiple document names selected, and when this is passed to the next script the only variable retained is the last doc in the list because the data is being overwritten for the variable.
Sorry if that is not clear, kind of a weird problem to begin with...Almost forgot the important parts.
I am using perl and I am using the POST method for passing data between scripts.version2,
Is it possible to provide a url to your script, to see what your trying to do?
Regards,Actually, its an intranet project. Let me see if I can word it a little better.
Using the code below:
read(STDIN,$submit,$ENV{'CONTENT_LENGTH'});
foreach $pair (split('&', $submit))
{
if ($pair =~ /(.*)=(.*)/)
{
($key,$value) = ($1,$2); # get key, value.
$value =~ s/\+/ /g; # substitute spaces for + signs.
$value =~ s/%(..)/pack('c',hex($1))/eg;
$inputs{$key} .= "\0" if (defined($inputs{$key}));
$inputs{$key} = $value; # Create Associative Array.
}
}
I am losing all of my lists that have multiple selected items because that key/value pair is being overwritten. I just cant find the reason why this is happening. Thanks in advance.Try modifying your parse code a little and see if it helps:
if (defined($inputs{$key})) {
$inputs{$key} .= "\0";
}
$inputs{$key} .= $value; # Create Associative array
Regards,
KevinThanks Kevin. Finally got it...