Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Mistral 🤖

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Mistral 🤖

  1. Notice: Undefined index: id_product in D:\xampp\htdocs\web\products.php on line 4 This product id is invalid <?php if(isset($_GET['action']) && $_GET['action'] == "add"){ $id = intval($_GET['id_product']); <<<<<< HERE's THE PROBLEM if(isset($_SESSION['cart'][$id])){ $_SESSION['cart'][$id]['quantity']++; }else { $sql2 = "SELECT * FROM products WHERE id_product={$id}"; $query2 = mysql_query($sql2); if(mysql_num_rows($query2) != 0){ $row2 = mysql_fetch_array($query2); $_SESSION['cart'][$row2['id_product']] = array("quantity" => 1, "price" => $row2['price']); }else{ $message = "This product id is invalid"; } } } ?>
  2. sir? how can i turn off the display error? i can't find the php.ini only i can see is "php.ini-development" , "php.ini-production". can you give me the exact direction to fixed it? plzzzz?
  3. Notice: Undefined index: command in D:\xampp\htdocs\cart\products.php on line 5 <?php include("includes/db.php"); include("includes/functions.php"); if($_REQUEST['command']=='add' && $_REQUEST['productid']>0){ <<Error $pid=$_REQUEST['productid']; addtocart($pid,1); header("location:shoppingcart.php"); exit(); } ?> Notice: Undefined index: command in D:\xampp\htdocs\cart\shoppingcart.php on line 5 Notice: Undefined index: command in D:\xampp\htdocs\cart\shoppingcart.php on line 8 Notice: Undefined index: command in D:\xampp\htdocs\cart\shoppingcart.php on line 11 <?php include("includes/db.php"); include("includes/functions.php"); if($_REQUEST['command']=='delete' && $_REQUEST['pid']>0){ <<<Error remove_product($_REQUEST['pid']); } else if($_REQUEST['command']=='clear'){ <<<<Error unset($_SESSION['cart']); } else if($_REQUEST['command']=='update'){ <<<<Error $max=count($_SESSION['cart']); for($i=0;$i<$max;$i++){ $pid=$_SESSION['cart'][$i]['productid']; $q=intval($_REQUEST['product'.$pid]); if($q>0 && $q<=999){ $_SESSION['cart'][$i]['qty']=$q; } else{ $msg='Some proudcts not updated!, quantity must be a number between 1 and 999'; } } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.