Passing PHP Arrays as type "hidden" in a HTML Form

From: Date: Tue, 12 Mar 2002 16:48:17 +0000
Subject: Passing PHP Arrays as type "hidden" in a HTML Form
Groups: php.dev 
Request: Send a blank email to php-dev+get-81082@lists.php.net to get a copy of this message
Hi, I am trying to pass an array with hidden type and access it by value. for eg: IN t.php <?php $a = array(1, 2, 3, 4, 5); print ("<form action =\"t1.php\" method = post >"); print("<input type = hidden name =\"_a\" value =$a >"); print("<input type =submit value=submit>"); print("</form>"); ?> IN t1.php (the page i am calling) <?php $a = $HTTP_POST_VARS["_a"]; echo $a[1]; //i want "2" to be printed here, since $a[0]=1, $a[1] =2 --- is it possible? ?> Any suggestions as to how can I pass the value of the array through an HTML form, would be a great help! Thanks, Surya __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/

« previous php.dev (#81082) next »