Hmm - this old chestnut again.

Be very careful when passing arrays, sometimes it seems to work swimmingly
well, othertimes not so well!
There was a lot of discussion about this about a month ago, with people
trying the serialise / urlencode techniques and then running into GET
problems over the length and such like (I think that Navigator imposes its
own restrictions here). Then when you try to POST instead, and pass the
array through as a hidden for instance you will find that it may not
unserialise properly.....
I know its complete overkill, but the only truly reliable ways that I have
found have been to use the array as a global (make sure globals are set!) or
to put it into a temporary db table and then pull it out again from the page
that needs it!

Tom

Doug Brewer wrote:

> try
> $foo  //array with serialized objects in it
> $foo = rawurlencode($foo);
> $url = "something/something/foobar.php?foo=$foo";
>
> and on the next page
>
> $foo = rawurldecode($foo);
> $foo = unserialize($foo);
>
> disclaimer: I didn't run thru these to see if it works
>
> although it might be better to pass it as a post arg--isn't there a
> length limitation on stuff passed via GET (?)
>
> DB
>
> | -----Original Message-----
> | From: Conover, Ryan [mailto:[EMAIL PROTECTED]]
> | Sent: Thursday, February 01, 2001 1:22 PM
> | To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> | Subject: [PHP-WIN] passing arrays of objects
> |
> |
> | I was wondering if I can pass an array that has serialized
> | objects to next
> | page via url encoding
> |
> | $foo  //array with serialized objects in it
> |
> | with the following encoding
> |
> | something/something/foobar.php?foo=echo($foo)
> |
> | and be able too unserialize $foo on the next page(foovar.php)
> |
> | ryan
> |
> | --
> | PHP Windows Mailing List (http://www.php.net/)
> | To unsubscribe, e-mail: [EMAIL PROTECTED]
> | For additional commands, e-mail: [EMAIL PROTECTED]
> | To contact the list administrators, e-mail:
> | [EMAIL PROTECTED]
> |
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to