Re: Passing Serialized Array via Hidden field

From: Date: Mon, 21 Jul 2003 13:23:10 +0000
Subject: Re: Passing Serialized Array via Hidden field
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-156058@lists.php.net to get a copy of this message
Andrei Verovski (aka MacGuru) wrote:
Hi, I am need to pass serialized assotiative array via form hidden field (not GET or POST). In order to do it, I did the following:
Ummmm....is there a third form method that I'm not aware of?
urlencode(serialize($my_array)). However, after retrieving data from hidden field and unserialize I've got junk.
Why are you urlencode'ing it?
Someone can explain me what I did wrong?
Did you urldecode it before you unserialized it? Better yet, don't urlencode it at all.
Also, do I need to do addslashes/stripslashes with serialized (or encoded ?) data?
You shoudn't, but if you add on the submit, don't forget to strip on the retrival.
Thanks in advance for any suggestion. ********************************************* * Best Regards --- Andrei Verovski * * Personal Home Page * http://snow.prohosting.com/guru4mac * Mac, Linux, DTP, Development, IT WEB Site *********************************************


« previous php.general (#156058) next »