Personally I would serialize and unserialize, but if you just want to pass the array the way you are doing it, you need to try this instead:
<form method=POST ACTION="updateHTML.php"> <? for ($I=0; $I<count($layer); $I++) { ?> <input type="hidden" name="layer[]" value="<?=$layer[$I]?>" /> <? } ?> This will create a bunch of hidden input types with your values. Cheers! Rick In order to seek truth it is necessary once in the course of our life to doubt as far as possible all things. - Rene Descartes > From: Pushkar Pradhan <[EMAIL PROTECTED]> > Date: Wed, 24 Apr 2002 13:02:17 -0500 (CDT) > To: [EMAIL PROTECTED] > Subject: [PHP] passing array as hidden field > > 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", .... > i.e. it doesn't remain an array anymore and thus I cannot do array > operations (eg. array_slice etc.) on it. > Can anyone tell how I can pass it to my forms as an array? Thanks > > > -Pushkar S. Pradhan > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php