[PHP] Re: Pass array in HTTP_POST_VARS question
you can also join() the elements and pass as a single string, then explode() the elements back again. Elias Paul Maine [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is it possible to pass an array in a form post? If so, how do I reference the array on the next page? Thank You Paul php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Pass array in HTTP_POST_VARS question
If you are in a session you can register the array and it will be available on the next page, once you finish working with the array, just unregister the array. File1.php action= file2.php session_start(); session_register(foo); var $foo = array(); File2.php session_start(); Work with $foo session_unregister(foo); Paul Maine [EMAIL PROTECTED] escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is it possible to pass an array in a form post? If so, how do I reference the array on the next page? Thank You Paul php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: Pass array in HTTP_POST_VARS question
you just name the form elements as array elements, e.g. with explicit keys name='array[0]' name='array[1]' etc. or allowing php to assign the keys name='array[]' name='array[]' etc. then the array is an element of $HTTP_POST_VARS[] when the form is posted Tim Ward www.chessish.com -Original Message- From: Paul Maine [mailto:[EMAIL PROTECTED]] Sent: 04 September 2002 03:25 To: PHP PHP Subject: Pass array in HTTP_POST_VARS question Is it possible to pass an array in a form post? If so, how do I reference the array on the next page? Thank You Paul php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Pass array in HTTP_POST_VARS question
Don't forget to use urlencode after serializing. David Robley wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Is it possible to pass an array in a form post? If so, how do I reference the array on the next page? Thank You Paul php I believe you may need serialize/unserialize here. Use serialize($array) to create a simple variable that can be passed, then at the other end, use unserialize to restore it. http://www.php.net/serialize for more info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Pass array in HTTP_POST_VARS question
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Is it possible to pass an array in a form post? If so, how do I reference the array on the next page? Thank You Paul php I believe you may need serialize/unserialize here. Use serialize($array) to create a simple variable that can be passed, then at the other end, use unserialize to restore it. http://www.php.net/serialize for more info -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php