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();
}
?>
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
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';
}
}
}
?>
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';
}
}
}
?>