Re: [PHP] pass array From: AJDIN BRANDIC (abrandic <email protected>)
Date: 11/03/00

Thanks all.

Ajdin

On Thu, 2 Nov 2000, Matt McClanahan wrote:

> On Thu, 2 Nov 2000, AJDIN BRANDIC wrote:
>
> > Hi,
> >
> > Is it possible to pass an array from one page to another without using
> > cookies or sessions. ie. as a hidden form feild or href=blah.php3?myarray[]
> > ??????
>
> I wonder if this shouldn't be a faq entry somewhere. It comes up fairly
> reguarly.
>
> Yes, you can pass arrays between pages. To do so, you must first
> serialize and urlencode the array.
>
> Page 1:
>
> $param = urlencode(serialize($array));
> echo '<a href="page2.php?param=' . $param . '">Pass array</a>';
>
> Page 2:
>
> $array = unserialize(urldecode($param));
>
> http://www.php.net/manual/function.serialize.php
> http://www.php.net/manual/function.urlencode.php
>
> Matt
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>