-1

プロジェクトの 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 ステートメントの何が問題になっていますか?

4

1 に答える 1

2

あなたはphpをisset()間違って使用しています。isset()変数引数が必要であり、「[決定] 変数が設定されていて NULL でないかどうか」。

これを試して:

if (($qty > 0) && ($type != 'submit') && !isset($checkbox)) {

}
于 2013-05-04T18:12:36.107 に答える