Re: problem passing variable between forms.
| From: | Lowell Allen | Date: | Tue, 26 Aug 2003 14:05:01 +0000 |
| Subject: | Re: problem passing variable between forms. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160759@lists.php.net to get a copy of this message | ||
> I have a form in which I have a table with dynamic checkboxes, they are in a
> checkbox array ( name = chk[]...), I pass this variable to the next page
> using POST I receive the variable and use it, no problem, but then when I
> try to pass it to the next form in the URL (using an A HREF:
>
> <a href='confirmrequest.php?requested=" . $chk . "'> )
>
> then it doesnt get passed. I have also tried sending it with POST and a
> submit button
Isn't $chk an array? To pass an array in a form, you should serialize it and
encode it, then after receiving it you decode it and unserialize it:
$portable_array = base64_encode(serialize($array));
You can then pass $portable_array as a form hidden input value. To turn it
back into an array:
$array = unserialize(base64_decode($portable_array));
--
Lowell Allen