Passing Arrays in URLs - A Better Way?
Posted: Thu Sep 11, 2003 3:32 am
Passing Arrays in URLs. I.e passing arrays between two pages.
This has been delt with before but I can't help feeling there is a better way. The current options are:
serialize and urlencode .... then ... urldecode and unserialize
OR
implode ... then ... explode
OR
use session variables/cookies
But if you create a form with a multiple select in it like so:
<SELECT NAME=selectname[]> etc
.. the array $selectname appears automatically in the backend when the form is submitted. Note that $selectname is an array. This means that php must automatically create arrays from data POSTed in a particular format.
If we could pass an array in this format in a url or a hidden form then we wouldn't have to do anything on the recieving page.
Anyone know what this format is?
This has been delt with before but I can't help feeling there is a better way. The current options are:
serialize and urlencode .... then ... urldecode and unserialize
OR
implode ... then ... explode
OR
use session variables/cookies
But if you create a form with a multiple select in it like so:
<SELECT NAME=selectname[]> etc
.. the array $selectname appears automatically in the backend when the form is submitted. Note that $selectname is an array. This means that php must automatically create arrays from data POSTed in a particular format.
If we could pass an array in this format in a url or a hidden form then we wouldn't have to do anything on the recieving page.
Anyone know what this format is?