Guy Bowden guy at holler.co.uk
Wed Oct 29 13:28:35 CST 2003

Have you declared a method 'person' inside the class 'person'?

This method is called when you say :

$myPerson = new person();

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Jacques Capesius
Sent: 29 October 2003 18:06
To: 'Thelist at Lists. Evolt. Org'
Subject: [thelist] 

Hi folks,

I'm starting to dabble in some PHP and have run into a real stumper (at
least for me).

I have a PHP class, person, that looks like this:

class person {
   // set up the object
   var $firstname;
   var $lastname;
   var $email;
   var $username;
   var $password;
   var $loggedin;
   var $group;
// plus various methods...

Upon successful login, I load the attributes with their respective values
and load the variable of type person into a session variable via the
following code:

$_SESSION["person"] = $person; // person is the variable.

I then forward to a different page and try to read from the session with the
following code:

echo "<br>firstname: ".$_SESSION["person"]->firstname."<br>";

the output is: 

    [person] => __PHP_Incomplete_Class Object
            [__PHP_Incomplete_Class_Name] => person
            [firstname] => Jacques
            [lastname] => Capesius
            [email] => jacques_capesius at cnt.com
            [username] => jcapesius
            [password] => 
            [loggedin] => 1
            [group] => ibm

<br>firstname: <br>

Obviously, the second line of code above isn't working. My question is, how
to I refer to the attribute values of an object I have stored in a session

thanks for any help you can offer.

-jacques :)
* * Please support the community that supports you.  * *

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 

More information about the thelist mailing list