note 3684 deleted from serialize by ronabop
| From: | ronabop@php.net | Date: | Sun, 03 Sep 2000 11:00:25 +0000 |
| Subject: | note 3684 deleted from serialize by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4063@lists.php.net to get a copy of this message | ||
I've also been having some difficulty in using this function with an object.
I have a form that posts variable to a page which declares an instance of a class, sets the class
instance's internal variables from global form variable, then attempts to serialize the object,
urlencode it, pass it in the url to another page, and I get the error "The page cannot be
displayed" I'm beginning to think it may be the size of the object I am passing. When I do
this same thing with a simple integer, there are no errors.
The code I'm using is:
$object = new class;
$object->read(); // stuffs object with vars from $GLOBALS[]
$serialized_object = serialize($object);
$urlencoded_object = urlencode($serialized_object);
Header("Location:/nextpage.phtml?object_pass=$urlencoded_object");
On the next page I have
$serialized_object = urldecode($object_pass);
$object = new class;
$object = unserialize($serialized_object);
Like I said, if I use the same procedure without classes, everything goes fine...