看板 PHP 關於我們 聯絡資訊
※ 引述《smileray ()》之銘言: : 程式碼 因為太長了 : 所以只擷取部分跟 錯誤訊息 : 問題一 : Notice: Undefined index: submit_item in d:\program : files\easyphp1-8\www\project\modify.php on line 5 : 程式碼是這段 @@ : if($_POST['submit_item'] == "修改"){ : 問題二 : Notice: Undefined index: id in d:\program : files\easyphp1-8\www\project\modify.php on line 35 : 程式碼 : $sql .= " where `id`='".$_GET['id']."'"; : 問題三 : Notice: Undefined variable: name in d:\program : files\easyphp1-8\www\project\modify.php on line 26 : 修改完成!! : 回瀏覽頁 : Notice: Undefined index: id in d:\program : files\easyphp1-8\www\project\modify.php on line 35 : 程式碼 : $sql .= " where `id`='".$_GET['id']."'"; line35 : echo "修改".$name."完成!!<BR>"; line 26 Notice: Undefined index|variable: xxxxx 若原程式長這樣子 echo "this is a test $var"; 請改成 if (isset( $var)) { echo "this is a test $var"; } 可以避開變數未定義前去呼叫它 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.245.58
buganini:或把錯誤顯示設為E_ALL &~E_NOTICE 04/13 22:45
smileray:可以囉 謝謝你們~ 04/13 23:49