You need to declare the class before you call session_start(). Otherwise
it can't create the object properly.
Peter Lauri wrote:
Hi,
I do this:
<?php
session_start();
require_once('classes/ns_cart.class.php');
if(!isset($_SESSION['ns_cart'])) $_SESSION['ns_cart'] = new NScart();
?>
The output will be the following with print_r of the $_SESSION:
--------------------
Array
(
[ns_cart] => nscart Object
(
[myProducts] => Array
(
[0] => ns_product Object
(
---------------------
When I reloads the page I get the following:
--------------------
Array
(
[ns_cart] => __PHP_Incomplete_Class Object
(
[__PHP_Incomplete_Class_Name] => nscart
[myProducts] => Array
(
[0] => __PHP_Incomplete_Class Object
---------------------
What is this? I am confused...
/Peter
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php