// Syntactical Errors, Find the corrected code!!
switch($action)
{
case "add":
if (isset($_SESSION['cart'][$id])) {
$_SESSION['cart'][$id]++;
}
else {
$_SESSION['cart'][$id]=1;
}
break;
case "remove":
if (isset($_SESSION['cart'][$id])) {
$_SESSION['cart'][$id]--; //(ERROR HERE)
}
if ($_SESSION['cart'][$id]==0) {
unset($_SESSION['cart'][$id]);
}
break;
case "empty":
unset($_SESSION['cart']);
break;
}