session_start();
session_destroy();
$page = 'index.php';
mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('cart') or die(mysql_error());
if (isset($_GET['add']))
{
$quantity = mysql_query('SELECT id, quantity FROM products WHERE id='.mysql_real_escape_string((int)$_GET['add']));
while ($quantity_row = mysql_fetch_assoc($quantity))
{
if ($quantity_row['quantity']!=$_SESSION['cart_'.(int)$_GET['add']])
{
$_SESSION['cart_'.(int)$_GET['add']]+='1';
}
}
}
Notice: Undefined index: cart_1 in D:\wamp\www\dev\shopping_cart\cart.php on line 42
到底有什么问题???
|