Well I'm here again🙂 with another question Ps just be patient I'm still new to programming.
I'm creating a bookshop. I can browse and view specific book details but I have a problem getting values into a cart which is in session. how can this be done. help.
take a view at the code I have
<?
session_start();
if($new)
{
if(!session_is_registered("cart"))
{
$cart=array();
session_register("cart");
$items = 0;
session_register("items");
$totalprice ="0.00";
session_register("totalprice");
}
if($cart[$new])
$cart[$new]++;
else
$cart[$new] =1;
}
?>
<html>
<head>
<title></title>
</head>
<body>
<form method=post>
<H3>Cart</H3>
<?php
$isbn=htmlspecialchars(stripslashes($isbn));
print "$isbn";
$cart[]=$isbn;
?>
when I try to output the values in cart it tells me it is empty.
why? when the cart is in session
</form>
</body>
</html>