hello, i've got a problem with objects in a session variable.
here's the code, who isn't work...
class abc {
var $index=0;
var $hallo=2;
function getindex() {
return $index;
}
};
session_start();
session_register("SESSION");
if (!isset($SESSION)) {
$SESSION = array();
}
if (!isset($SESSION["abc"])) {
$SESSION["abc"] = new abc;
}
/ ***************************** /
echo $SESSION["abc"]->getindex();
... this function calls an errormessage like this:
<b>Fatal error</b>: The script tried to execute a method or access a property of an incomplete object.
Please ensure that the class definition <b>abc</b> of the object you are trying to operate on
was loaded before the session was started in <b>d:\apache\htdocs\session.php</b> on line <b>26</b><br>
when i only write simple variables into the session, i haven't any errors, but with objects. can you help me?
i've got running php 4.0.5 on my computer.
thanx,trjo