__PHP_Incomplete_Class Object
| From: | Weston Houghton | Date: | Thu, 30 Jan 2003 05:20:51 +0000 |
| Subject: | __PHP_Incomplete_Class Object | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-133595@lists.php.net to get a copy of this message | ||
Ok, now I'm frustrated.
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();
$myMailer->buildRecipients();
$_SESSION['myMailer'] = $myMailer;
?>
If I print_r the $_SESSION on that page, everything looks fine. So I then move to my second page, and use:
<?php
session_start();
$myMailer = &$_SESSION['myMailer'];
if ($myMailer) {
$addressArray = $myMailer->getRecipients();
} else {
$addressArray = null;
}
?>
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
(
[__PHP_Incomplete_Class_Name] => nycmgmail
...
and in the error log I see:
[29-Jan-2003 23:58:09] PHP Fatal error: Unknown(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition <b>nycmgmail</b> of the object you are trying to operate on was loaded _before_ the session was started in /.../.../.../.../admin/addresses.php on line 6
I swear I have done all of this before, but it is just not working now, and for the life of me I can't see anything right in front of me.
Help! Please?
thanks,
Wes
---------------------------------------------------------------------------
The selection and placement of letters on this page was
determined automatically by a computer program. Any
resemblance to actual words, sentences, or paragraphs is
pure coincidence, and no liability will be assumed for
such coincidences.
---------------------------------------------------------------------------