OK so this is what I did: I have made web site, I was using xampp sever, I created database in phpMyAdmin, but there was a problem and I had to reinstall xampp, so with that I deleted the database(yes, i didn’t make backup:( ), so I after I install xampp, I created teh same database. But now when I run localhost/website I have a problem with some lines:
Notice: Undefined index: command in C:\xampp\htdocs\BookShop\klasici.php on line 6
and this is on line 6:
if($_REQUEST['command']=='add' && $_REQUEST['productid']>0){
I think the problem is with the session, but I haven’t changes nothing in the scripts. The session starts after the connections with the database. Thank you
But now when I changed the line above with this one:
if(isset($_REQUEST['command']) && $_REQUEST['command']=='add' && $_REQUEST['productid']>0)
{
I have another problem, I can’t not update or delete any itam in the shopping cart, below is a part of the code where I think something is wrong:
if(isset($_REQUEST['command']) && $_REQUEST['command']=='add' &&$_REQUEST['productid']>0)
{
remove_product(isset ($_REQUEST['pid']));
}
else if(isset($_REQUEST['command'])=='clear'){
unset($_SESSION['cart']);
}
else if(isset($_REQUEST['command'])=='update'){
$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';
}
}
}
try changing it to
if(isset($_REQUEST[‘command’]) && $_REQUEST[‘command’]==’add’ && $_REQUEST[‘productid’]>0)