|
Posted by Erwin Moller on 10/20/05 16:00
Python wrote:
> Hi
>
> I need to know how to keep instance of class. For example. I created
> object:
>
> $myObj = new Person();
>
> ok, and then someone wants to go to the links page, and I want to keep
> data which are created in myObj, for exmaple $myObj->age; $myObj->name;
> etc. etc.
>
> I thought about $serMyObj = serialize($myObj) and the put $serMyObj
> data through POST, GET, or sth like that, and then GET it, but what if
> the portal is big and i want to keep 50 objects in one session ?? put
> data to the database and after that get it and every time someone is
> redirecting to the another page, get form database ...
Hi Python,
I may make more sense for you to use SESSION instead of passing info around
with POST and GET.
Read here:
http://nl3.php.net/session
Be sure you read the about Objects and Session, because there are some
issues if you first start a session, and then declare the object.
First load the objectdefinition, then start the session, but that is all
explained at the php site.
Good luck.
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|