Re: posting an array



Mark D Smith wrote:

>i am posting a hidden values called accounts which is a number of usernames
>pushed to an array.
>
>print "<input type=hidden name=accounts value=\"@accounts\">";
>
>the page that receives the data should be able to unpack the array but i am
>having problems

Use one such line per array item. And please *html-escape* each item.

foreach (@accounts) {
printf "<input type=hidden name=accounts value=\"%s\">\n",
escapeHTML($_);
}

>&ReadParse();

Ugh. Please don't tell me you're still using cgilib.pl.

escapeHTML() is exported if you use CGI like this:

use CGI ':standard';

--
Bart.
.



Relevant Pages