display user entered data in the form before submitting to database
<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 user_confirm.php</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? please help me
thanks in advance</p>

<p>here is my register2_db.php


<p>$host="localhost"; // Host name 
$username="fissioni"; // Mysql username 
$password="password("; // Mysql password 
$db_name="fissioni_test"; // Database name 
$tbl_name="members"; // Table name</p>

<p>// 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");</p>

<p>$query = 'insert into members (username,password,name,phone_number) 
                    values
                    (
                    "' . $_POST['username'] . '", 
                    "' . md5($_POST['password']) . '",
                    "' . $_POST['name'] . '",
                    "' . $_POST['phone_number'] . '",
                    )';</p>

<p>$result = mysql_query($query);</p>

<p>if($result){
    echo '<h1>Thank you</h1> <br> Go back to the main page 

<p>?></p>
