Reply to Re: [PHP] PHP 5.0. Save classes in a session. Need help now

Your name:

Reply:


Posted by Richard Lynch on 05/12/05 04:59

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация