Can someone help me out with this code:
I am sending values via a form to a session array but it is not storing the values, so everytime I click the submit button it is supposed to increment but it is not doing that.
This is the form:
<form method="post" action="">
<input name="Title" type="hidden" value="$5 Donation With Shipping" />
<input name="Price" type="hidden" value="5.00" />
<input type="submit" name="Submit" value="Add To Cart" />
</form>
and this is the shopping cart script:
<?php
session_start();
$SESSION['id'] = $POST['isbn'];
$title = $POST['title'];
$qty = $POST['cmd'];
$new =0;
if(!isset($SESSION['id']))
{
$SESSION['cart'] = array();
$SESSION['title'] ='';
$SESSION['price'] = '0.00';
echo $new . $SESSION['title'];
}else{
$SESSION['cart'] = array($title => $qty);
$_SESSION['id']++;
}
foreach ($_SESSION['cart'] as $key => $value)
{
echo '<table><tr><td>' . $value . '</td></tr></table>';
}
?>
Can someone help me please