3
因此,我將這種表單提交給PHP腳本,該腳本回響$ _SERVER ['REQUEST_METHOD']。我不知道爲什麼,但即使我在表單中指定了POST方法,它總是迴應GET。爲什麼是這樣?我究竟做錯了什麼?在表單上使用php和POST,但request_method表示它是GET
<form action="location.php" method="POST">
<table>
<tr>
<td>name</td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td>address</td>
<td><input type="text" name="address"></td>
</tr>
<tr>
<td>lat</td>
<td><input type="text" name="lat"></td>
</tr>
<tr>
<td>lng</td>
<td><input type="text" name="lng"></td>
</tr>
<tr>
<td>user</td>
<td><input type="text" name="user"></td>
</tr>
<tr>
<td>type</td>
<td><input type="text" name="type"></td>
</tr>
<tr>
<td>method</td>
<td><input type="text" name="methoda"></td>
</tr>
<tr>
<td><input type="submit" name="submit"></td>
</tr>
</table>
</form>
它是一個錯字,還是你忘記了''閉上你的''
我忘記了,更新了代碼,仍然有同樣的問題。 – 2011-03-18 21:58:49
在不熟悉'$ _SERVER ['REQUEST_METHOD']'的情況下,我想要求您嘗試調用echo(「
」);'或echo(「 」);' location.php文件,以顯示GET和POST數組。嘗試一些值。 – Ragnar123 2011-03-18 21:58:59回答
因爲我花了無數的時間試圖解決有關「REQUST_METHOD」是錯在PHP和沒有找到任何有用的在線的一個錯誤,這是我對這個問題的報告:Chrome瀏覽器似乎有一個錯誤版本30.0.1599.101
我的jQuery測試代碼爲:
PHP:
Chrome的響應PUT,PUT,在Opera GET 預期POST,PUT,GET
來源
2013-11-12 11:23:07 marcgfx
相關問題