0

I have stored a value in a array and that am passing it to action of form tag via session but sadly in url am getting the thing as it is, no value displayed in url..!!please helpme out of this.pardon me if am wrong..!!

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
at another page

<?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);
?>
}
huysentruitw
  • 27,376
  • 9
  • 90
  • 133

1 Answers1

0

You need to change your form tag to below:

<form id = "form" name = "form" class="validate-form" method="POST" action="formprofile.php?vno = <?php echo $_SESSION['vault_no']; ?>" autocomplete = "off" >

You are passing $_SESSION['vault_no'] directly without in PHP tag and echo.

Hardik Solanki
  • 3,153
  • 1
  • 17
  • 28
  • such a silly mistake..!!thanks a ton sir...!! i will accept it after 5 mins..!! sir if you dont mind can u please guid me over this question -> http://stackoverflow.com/questions/34545184/php-session-variable-not-passed-in-live-server –  Jan 02 '16 at 07:00