note 30883 added to function.session-register
| From: | ice at thesurf dot no-ip dot com | Date: | Wed, 02 Apr 2003 10:09:34 +0000 |
| Subject: | note 30883 added to function.session-register | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46108@lists.php.net to get a copy of this message | ||
If you use objects it is alsways a good idear to make a var or array that hold your object-handler
exampel:
include("class.exmaple.php");
$obj = new exampel ();
$se_obj = serialize($obj);
$_SESSION['se_obj']=$se_obj;
when you then got on the next page and so a start_session()
and you don't habe includet the classdescription, your object will still not break.
Just do a
include("class.example.php");
$obj = unserialze($_SESSION['se_obj']);
and all is fine.
This is a preaty good trick if you do some includings in the next page an use the object in a file
you include :)
--
http://www.php.net/manual/en/function.session-register.php
http://master.php.net/manage/user-notes.php?action=edit+30883
http://master.php.net/manage/user-notes.php?action=delete+30883
http://master.php.net/manage/user-notes.php?action=reject+30883