我已经在数组中存储了一个值,并且通过会话将其传递给表单标记的操作但遗憾的是在url我得到的东西是原样,没有在url中显示的值.. !!请帮助这个。如果我错了,请原谅我。!!
reg.php
<?php
session_start();
?>
<form id = "form" name = "form" class="validate-form" method="POST" action="formprofile.php?vno = $_SESSION['vault_no']" autocomplete = "off" >
reg1.php
在另一页
<?php
session_start();
$user = $db->storeUser($salutation, $fname, $lname, $dob, $mobile, $country, $state, $city, $pin);
if ($user) {
// user stored successfully
$response["error"] = false;
$_SESSION['fullname'] = $user['fullname'];
$_SESSION['vault_no'] = $user['vault_no'];
echo json_encode($response);
}
else
{ // user failed to store
$response["error"] = true;
$response["error_msg"] = "Unknown error occurred in registration!";
echo json_encode($response);
?>
}
答案 0 :(得分:0)
您需要将表单标记更改为以下内容:
<form id = "form" name = "form" class="validate-form" method="POST" action="formprofile.php?vno = <?php echo $_SESSION['vault_no']; ?>" autocomplete = "off" >
您在$_SESSION['vault_no']
和PHP tag
内直接传递echo
。