title: display user entered data in the form before submitting to database
body: <p>I have a user form where user enters his data. After user enters data i should display it for his confirmation before submitting to database. 
  I have written a code. if i display the data for user confirmation, it is not getting stored after confirmation. if i directly submit to the database it will get stored. </p>
  
  <p>Please look onto my code and help me where i am doing wrong.</p>
  
  <p>Here is my form</p>
  
  <pre><code>&lt;form name="registration_form" method="post" action="user_confirm.php" 
      onsubmit="return Validate();"&gt;
      User Name:
  &lt;input type="text" name="username"/&gt;&lt;br /&gt;&lt;br /&gt;
  
      Password: 
      &lt;input type="password" name="password" /&gt;&lt;br /&gt;&lt;br /&gt;
      Retype Password: 
      &lt;input type="password" name="password_confirmation"&gt;&lt;br /&gt;&lt;br /&gt;
      Name:
      &lt;input type="text" name="name" /&gt;&lt;br /&gt;&lt;br /&gt;
      Phone Number: 
      &lt;input type="text" name="phone_number"&gt;&lt;br /&gt;
      &lt;br /&gt;
  &lt;input type="submit" value="Click here to confirm"  /&gt;&lt;br /&gt;
  
      &lt;/form&gt;
  </code></pre>
  
  <p>and here is my <strong>user_confirm.php</strong></p>
  
  <pre><code>&lt;?php
  $username= $_POST['username'];
  $name = $_POST['name'];
  $phone_numbe = $_POST['phone_numbe'];
  
  echo $username "&lt;br&gt;";
  echo $name "&lt;br&gt;";
  echo $phone_number " &lt;br&gt;";
  ?&gt;
  
  &lt;form action="register2_db.php" method="post"&gt;
  &lt;input type="hidden" name="redirect_values" value="true"&gt; 
  &lt;input type="submit" name="confirm" value="Confirm Details"&gt;
  &lt;input type="button" name="return" value="Return to data" onClick="javascript: window.history.back(-1)";&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Why this value is not getting stored in database after confirmation ?</p>
  
  <p>Here is my <strong>register2_db.php</strong></p>
  
  <pre><code>&lt;?
  
  $host="localhost"; // Host name 
  $username="fissioni"; // Mysql username 
  $password="password("; // Mysql password 
  $db_name="fissioni_test"; // Database name 
  $tbl_name="members"; // Table name
  
  // Connect to server and select databse.
  mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
  mysql_select_db("$db_name")or die("cannot select DB");
  
  $query = 'insert into members (username,password,name,phone_number) 
                      values
                      (
                      "' . $_POST['username'] . '", 
                      "' . md5($_POST['password']) . '",
                      "' . $_POST['name'] . '",
                      "' . $_POST['phone_number'] . '",
                      )';
  
  $result = mysql_query($query);
  
  if($result){
      echo '&lt;h1&gt;Thank you&lt;/h1&gt; &lt;br&gt; Go back to the main page &lt;a href="index.html");';
  }else{
      echo "ERROR: ".mysql_error(); 
  }
  
  ?&gt;
  </code></pre>