note 751 deleted from function.unserialize by john
| From: | john@php.net | Date: | Wed, 20 Nov 2002 02:33:48 +0000 |
| Subject: | note 751 deleted from function.unserialize by john | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-39720@lists.php.net to get a copy of this message | ||
I made an entry about serialize, but the problem seems to be unserialize. Apparently, passing form
variables with serialize/urlencode and urldecode/unserialize works, but passing strings or arrays as
query strings does not. The simplest example I can think of deserializes to null for query strings.
e.g.
page 1)
$string="help";
$string=urlencode(serialize($string));
<a href='mypage?stringpassed=$string'>click here</a>
page 2)
$passedstring=unserialize($stringpassed);
or $passedstring=unserialize(urldecode($stringpassed));
yield null. For arrays, they yield empty arrays. PHP 3.07 under Linux kernel 2.0.35 (SLACKWARE) and
Apache 1.3.6