Menu
Hi…im trying to remove item from session but it doesnt delete!
[code=php]if(isset($_GET[‘action’]))
{
$choice=$_GET[‘action’];
if($choice==’add’)
{
$Pid=$_GET[‘id’];
$_SESSION[‘baseket’][$Pid]++;
header(“Location:mobiles.php”);
}
if($choice==’remove’)
{
$Pid=$_GET[‘id’];
$_SESSION[‘baseket’][$Pid]–;
if(isset($_SESSION[‘basket’][$Pid])<=0)
{
//echo “<script>alert(‘zero items!’);</script>”;
unset($_SESSION[‘basket’][$Pid]);
}
}
if($choice==’empty’)
{
unset($_SESSION[‘baseket’]);
header(“Location:mobiles.php”);
}
}
?>
?