-2
我有一個簡單的註冊表格:表單POST失敗
<h2>Signup</h2>
<form action="actions.php">
Email:<br>
<input type="text" name="lastname">
<br>
Password:<br>
<input type="text" name="lastname">
<br>
<br>
<input type="submit" name="signupButton" value="submit">
</form>
這裏是我的actions.php:
<?php
echo 'test1';
if(isset($_POST['signupButton'])){
echo 'test2';
}
?>
但是當我點擊提交按鈕,顯示的頁面是隻能說明:
test1的
爲何按鈕被點擊未能通過if語句?
你嘗試:'<形式行動= 「actions.php」 方法= 「郵報」>'? – smoqadam
默認的表單方法是GET – RamRaider
@ Fred-ii-〜有趣的是,當它看起來很明顯是代表@ops的錯誤,我同意'$ _POST'調用與表單默認方法 – RamRaider