Re: Can't printout class variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Scott Gunn wrote:
This should be simple.  What am I doing wrong?

Here is the code that is failing:

    $user = $_SESSION['user'];
    print_r($user);
    echo "Welcome " . $user->firstName;

The print_r command prints out:

__PHP_Incomplete_Class Object ( [__PHP_Incomplete_Class_Name] => User [isLoggedIn] => 1 [lastName] => Gunn [firstName] => Scott )


try
$user = (User)$_SESSION['user'];
rest remains the same.

--
Sumeet Shroff
http://www.prateeksha.com
Web Design and Ecommerce Development, Mumbai India

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux