用PHP将表单方法放入html中
我正在尝试通过html表单更新记录。但我有一个问题,当我单击SUBMIT时,如果($\u SERVER['REQUEST\u METHOD']==“PUT”){}未被激活,那么我会遇到这个问题 我的表格html:用PHP将表单方法放入html中,php,forms,put,Php,Forms,Put,我正在尝试通过html表单更新记录。但我有一个问题,当我单击SUBMIT时,如果($\u SERVER['REQUEST\u METHOD']==“PUT”){}未被激活,那么我会遇到这个问题 我的表格html: 在HTML5中,您不能将方法设置为表单形式 您可以改为在表单中添加一个隐藏字段 <form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
在HTML5中,您不能将方法设置为表单形式 您可以改为在表单中添加一个隐藏字段
<form method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
ID : <input type="text" name ="idCar1">
NAME CAR: <input type="text" name="nameCar1" >
YEAR CAR: <input type="text" name="yearCar1">
<input type="hidden" name='_METHOD' value="PUT">
<input type="submit" value="SUBMIT">
<input type="hidden" name="_method" value="PUT">
<br><br>
<span style="color:red">* <?php echo $idUpdateErr;?> </span>
</form>