提问人:rmunoz 提问时间:5/2/2023 更新时间:5/2/2023 访问量:23
将识别号码车传递到输入字段 PHP
pass identify number car to input field php
问:
我查询了个人身份代码,它有效,并且我放置了一个按钮来输入该个人识别码的新记录,但输入不起作用,它记录了信息而不是个人身份
我需要在PHP页面中传递个人代码并保存到MySQL
答:
0赞
cp1
5/2/2023
#1
如果没有一些代码,您的问题有点含糊不清,但我收集您想要这样的东西:
索引:.html
<!--- use POST instead of GET, to keep "personal identity code" out of the URL --->
<form action="addRecord.php" method="post">
<label for="code">Personal Identity Code: </label>
<input type="text" id="code" name="code" placeholder="1234">
<input type="submit" value="Submit">
</form>
添加记录:.php
$code = $_POST["code"];
// your sql query here...
在对输入运行 sql 查询之前,请确保对输入进行适当的清理。
评论