Heya我得到这个错误信息。我一直在寻找,但我不知道如何解决它?我是初学者,所以我真的很困惑。在此先感谢PHP未定义索引
注意:未定义指数:车在/nas/students/j/j39-green/unix/public_html/ISD5/inc/functions.inc.php第3行
你在没有任何项目您的购物车
<?php
function writeShoppingCart() {
$cart = $_SESSION['cart'];
if (!$cart) {
return '<p>You have no items in your shopping cart</p>';
} else {
// Parse the cart session variable
$items = explode(',',$cart);
$s = (count($items) > 1) ? 's':'';
return '<p>You have <a href="cart.php">'.count($items).' item'.$s.' in your shopping cart</a></p>';
}
}
错误是在函数..Inc.php不是你的代码 – 2012-03-14 20:26:15