I don't see where you include() your class definition in that second
file...  add include("nycmgMail.php") right before the session_start()
line and see if that makes a difference.

-philip

On Thu, 30 Jan 2003, Weston Houghton wrote:

>
> 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.
> ------------------------------------------------------------------------
> ---
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

Reply via email to