RE: [PHP] SESSIONS: What does this error mean
| From: | Taylor, Stewart | Date: | Thu, 10 May 2001 07:34:33 +0000 |
| Subject: | RE: [PHP] SESSIONS: What does this error mean | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-52238@lists.php.net to get a copy of this message | ||
This error occurrs when you start a session that recreates an object
variable but does not know the class definition for it.
You need to make sure you include the class source before you start the
session.
-Stewart
-----Original Message-----
From: Davor Pleskina [mailto:davor.pleskina@vip.hr]
Sent: 10 May 2001 08:18
To: php-general@lists.php.net
Subject: [PHP] SESSIONS: What does this error mean
Fatal error: The script tried to execute a method or access a property of an
incomplete object. Please ensure that the class definition cl_korisnik_data
of the object you are trying to operate on was loaded _before_ the session
was started in user_info.php on line 72
I declared class like following in the first script file:
class cl_korisnik_data {
var $kname, $ime, $kid, $prezime, $jmbg, $klevel;
};
session_register("korisnik_data");
$korisnik_data = new cl_korisnik_data;
// Then loaded some data into $korisnik_data, all passed OK
In called script user_info.php i wrote code:
<?php
session_start();
echo($korisnik_data->ime);
?>
... and got upper error. Now, what is wrong?
Just to make better question,
do classes also need to be registered within a session?
If so, how?
TIA,
Davor
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net