Marc Serra wrote:

Hi,

I got problem when i want to save object in session.



I got my first page when I create my object and save it to session:



<?php

Require 'test.inc.php';

Session_start();



$test = new test();

$test->Load($_Get['id']);

$_SESSION['save'] = $test;

?>



In my second page I want to retrieve my object

<?php



Require 'test.inc.php';

Session_start();

echo get_class($_SESSION['test']);

?>



When I do get_class($_SESSION['test']); I got the message
"__PHP_Incomplete_Class" instead of "test"



Can you explain me where I can have made an error.




What's going on here is that you haven't redefined your class for PHP in the second page. When PHP saves your object, it saves only its data, not its functions and such. Are you sure you're defining your object correctly? Have you tried instantiating a test() object in the second page?


--
paperCrane <Justin Patrin>

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



Reply via email to