On Thursday 25 April 2002 02:02, Pushkar Pradhan wrote:
> I want to pass a 1 dim. array through a form, I use the hidden field and
> do as follows:
> <form method=POST ACTION=\"updateHTML.php\">
> <input type=hidden name=layer[] value=\"";
> foreach($layer as $lay) {
> print "$lay ";
> }
> print "\">
> This generates the foll. source:
> <form method=POST ACTION="updateHTML.php">
> <input type=hidden name=layer[] value="a b c d e f g h ">
> where actually it should be $layer[] = "a", "b", "c", ....
Actually you want the <input ...> inside the loop as well:
foreach($layer as $lay) {
print "<input type='hidden' name='layer[]' value='$lay'";
}
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
Old age is always fifteen years old than I am.
-- B. Baruch
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php