Re: PHP 5.0. Save classes in a session. Need help now

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 11, 2005 5:19 pm, Oscar Andersson said:
> Is it possibele to save a class in a session
>
> ex.
>
> $cl = new Class();
> $SESSION['this_class'] = cl;

Yes, but...

You'd have to actually use $cl in that last line, and you need to require
the file that defines the class definition *BEFORE* you start your session
in the next page where you expect the class instance to exist.

Actually, you could maybe get away with starting the session, the loading
the class definition, then accessing the $cl variable...  But I'm not sure
of that, because I don't use classes, and even if I did, I'd load in all
the class files before I started my session, just on principle.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux