At 06:20 30.01.2003, Weston Houghton said: --------------------[snip]-------------------- >I'm trying to register an object in the session, and access that object >from 2 different pages. > >I start off in the first file, and do: ><?php >include("nycmgMail.php"); >session_start(); >$myMailer = new nycmgMail(); > > ... > >If I print_r the $_SESSION on that page, everything looks fine. So I >then move to my second page, and use: > >... > >Now when I do this, if I look at the $_SESSION object I see that that >class is now listed as: >[myMailer] => __PHP_Incomplete_Class Object --------------------[snip]--------------------
You need to include the class definition of an object _before_ instantiating it. If you omit the class definition, PHP has no chance to assign the correct class and uses a builtin default class. Include your class definition file before session_start() and you'll be fine. -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php