Session and Classdefinition
| From: | Michael Bunkart | Date: | Fri, 21 Jul 2000 11:18:25 +0000 |
| Subject: | Session and Classdefinition | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-1206@lists.php.net to get a copy of this message | ||
Hi,
is it possible to set a class-variable to a session-variable and work with
it on another page?
I have tested it, but I get the message:
"Fatal error: The script tried to execute a method or access a property of
an incomplete object. Please ensure that the class definition test of the
object you are trying to operate on was loaded _before_ the session was
started ..."
I have tested it on the second page with "session_is_registered()" and I get
True.
Page1:
class test
{
var $item;
}
$mycart = new test;
$mycart->item = 3;
session_register("mycart");
Page2:
echo session_is_registered ("mycart");
$mycart->item = 4;
For an assistance I would be grateful.
Thanks,
Michael Bunkart
michael.bunkart@bunkart.de