I have initialized a class in a session like so on products.php:
require_once("classes/shopping_cart.class.php"
;
$cCart = new shopping_cart();
session_register("cCart"
;
On cart.php I retrieve the cart like so:
$scCart =& $_SESSION["cCart"];
However, if I call:
$scCart->addProduct($ProductID);
I get this message:
Fatal error: Call to a member function on a non-object
Even if I call the session directly like:
$_SESSION["cCart"]->addProduct($ProductID);
Still get the same error, any ideas?
require_once("classes/shopping_cart.class.php"
$cCart = new shopping_cart();
session_register("cCart"
On cart.php I retrieve the cart like so:
$scCart =& $_SESSION["cCart"];
However, if I call:
$scCart->addProduct($ProductID);
I get this message:
Fatal error: Call to a member function on a non-object
Even if I call the session directly like:
$_SESSION["cCart"]->addProduct($ProductID);
Still get the same error, any ideas?