本文介绍了HTML表单字符串错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我点击发送请求按钮时,查询字符串?req_flag = 0 从URL中消失我在哪里犯了一个错误?我需要以下URL: localhost / flavourr / send_req.php?req_flag = 0& f_e_mail_add = value
When I click the "Send "Request" button, the query string ?req_flag=0 disappears from the URL. Where am I making a mistake here? I need following URL: localhost/flavourr/send_req.php?req_flag=0&f_e_mail_add=value
<pre> <form method="get" action="send_req.php?req_flag=0"> <input type="text" name="f_e_mail_add" value="Enter email of your friend" onblur='if (this.value == "") {this.value = "Enter email of your friend";}' onfocus='if (this.value == "Enter email of your friend") {this.value = "";}' size="35" /> <input type="submit" value="Send Request" /> </form></pre>推荐答案
只需添加如下所示的隐藏值并从action属性中删除'?req_flag = 0'。
Just add a hidden value as shown below and remove the '?req_flag=0' from the action attribute.
<form method="get" action="send_req.php"> <input type="text" name="f_e_mail_add" value="Enter email of your friend" size="35" /> <input type="hidden" id="req_flag" name="req_flag" value="0" /> <input type="submit" value="Send Request" /> </form>更多推荐
HTML表单字符串错误
发布评论