表單數據,我用這個代碼:復位上卸載
if(isset($_POST['btitle'])) {
if(count($errors) > 0) {
foreach($errors as $error)
$errContent .= "<li>".$error;
echo notification(
$errContent,
FALSE,
"The following errors were encountered:"
) . "<div style='margin-bottom: 10px;'></div>";
}
else {
echo notification(
"<li>New form added!",
TRUE,
"Success:"
) . "<div style='margin-bottom: 10px;'></div>";
}
}
當我輸入一個名爲「BTITLE」輸入的東西,點擊提交按鈕,一切都很好,直到我刷新頁面 - 它應該丟失數據並在刷新後重新開始,但它會一直說「成功」,即使「btitle」輸入爲爲空。
我在做什麼錯?