Undefined index error PHP

前端 未结 9 855
春和景丽
春和景丽 2020-12-01 08:24

I\'m new in PHP and I\'m getting this error:

Notice: Undefined index: productid in /var/www/test/modifyform.php on line 32

Notice: Undef

9条回答
  •  遥遥无期
    2020-12-01 08:43

    Apparently the index 'productid' is missing from your html form. Inspect your html inputs first. eg But this will handle the current error PHP is raising.

      $rowID = isset($_POST['rowID']) ? $_POST['rowID'] : '';
      $productid = isset($_POST['productid']) ? $_POST['productid'] : '';
      $name = isset($_POST['name']) ? $_POST['name'] : '';
      $price = isset($_POST['price']) ? $_POST['price'] : '';
      $description = isset($_POST['description']) ? $_POST['description'] : '';
    

提交回复
热议问题