if($new)
{
    //new item selected
    if(empty($_SESSION["cart"])) // 判断语句好像不对?
    {
        $_SESSION["cart"] = array();
        ......
    }
    if(!empty($_SESSION['cart'][$new]))
      $_SESSION['cart'][$new]++;
    else 
      $_SESSION['cart'][$new] = 1; 
}