include('header_product.php'); if($_GET['cart_product']){ $pid = (int) $_POST['pid']; $cart_result = mysql_query("select * from product where pid = '$pid'"); $cart_product = mysql_fetch_array($cart_result); $isexistence = 0; $keyexistence = 0; if($_SESSION[vip_cart]<>null){ foreach ($_SESSION[vip_cart] as $key => $pc) { if($pid==$pc['pid']){ $isexistence = 1; $keyexistence = $key; } }} if($isexistence==0){ $_SESSION[vip_cart][] =array( 'pid' => $cart_product['pid'], 'qty' => 1 ); }else{ $_SESSION[vip_cart][$keyexistence][qty] +=1; } } $pid = (int) $_GET['pid']; $result = mysql_query("select * from product where pid = '$pid'"); $product = mysql_fetch_array($result); $result = mysql_query("select * from category where cid = '$product[category]'"); $category = mysql_fetch_array($result); ?>