我使用了隐藏的输入字段,但在提交表单时,其数据未显示在网址中。
这是字段:
<input type="hidden" id="id" name="id" >
当我提交表单时,其值不会显示在网址中:
http://localhost/service/service.php?action=update_details&name='.kishor .'&lname='.patil .'&email='.kishor@gmail.com .'&username='.kishor123 .'&password='.1254.'&gender='.male.'&mobile='.9563201487 .'&address='.ads sd fds f.'id1='
我使用以下代码通过post检索所有表单值:
$id = $_GET["edit_id"];
if(isset($_POST["submit"]))
{
$id1 = $_POST["id"];
$name1=($_POST['name']);
$lname1=($_POST['lname']);
$email1=($_POST['email']);
$username1=($_POST['username']);
$password1=($_POST['password']);
$mobile1=($_POST['mobile']);
$address1=($_POST['address']);
$gender1=($_POST['gender']);
}
答案 0 :(得分:3)
那么问题是什么。您已创建一个隐藏的输入类型,没有问题,但您没有为其分配值。每个输入都必须有一个值。在您的情况下,您没有为其指定值。
<input type="hidden" id="id" name="id" value="'.$id.'">