我正在为一个项目制作一个 shoppingcart.php 文件,该文件由同一项目中另一个名为“catalog.php”的文件提供信息。我坚持的是while循环中的if语句(应该循环来自catalog.php的传入表单数据)。出于某种原因,它不喜欢这样:
//Loop through each form field (this page is called from catalog.php):
//If form field’s value (product quantity) is a positive number
//(nonzero), is NOT the submit button, AND the remove checkbox for
//removing this product has NOT been checked (do these checks in one
//condition):
while (list($productID,$qty) = each($_POST)){
if(($qty > 0) && (type != submit) && (checkbox != isset())){
}
}
我的 if 语句有什么问题?