Hi
I am having problems when trying to add an object to a session. This seemed to be wroking okay at one point, but since I have re0installed php to version 5.2
this is my code below, and the error i am getting is that the unserialize is expecting a string, which the $_SESSION['cartid'] should be
this is the error i get
PHP Fatal error: Call to a member function addToCart() on a non-object in C:\Program Files\Apache Group\Apache2\htdocs\pebbles\userCart.php on line 27
if(isset($_SESSION['cartid']))
{
$cart = unserialize($_SESSION['cartid']);
} else {
$cart = new Cart();
$_SESSION['cartid'] = $cart;
}
$jewelID = $_GET['jewelID'];
$image = $_GET['image'];
$price = $_GET['price'];
$name = $_GET['name'];
$qty = $_GET['qty'];
$cart->addToCart($jewelID,$image,$price,$name,$qty);
$cart->showCart();
?>
Am i getting the code wrong or could this be a configuration issue?
Any help would be fully appreciated
Ian