How to Connect two php form files, with the same id and save their data together in the database:
<p>I have a system which has only two transaction, Registration.php and req.php. The two transaction data are saved in the table new in my database. Registration.php is my first transacton, then req.php. This php files are form, which both has a submit button linked to add.php. The fields of my new table are devided in the two forms. The flow is that first Registration.php will be executed then req.php. My table new has a primary key named new_id and its auto increment. My problem is that, after execution of both forms, ONLY the data of Registration.php are save in the database table new and the req.php are blank. What is the problem? I need your help. </p>

<p>here is the Registration.php code:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;link rel="stylesheet" href="bootstrap/css/bootstrap.css"/&gt;
&lt;script type="text/javascript" src="jquery.js"&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="bootstrap/js/bootstrap.js"&gt;

&lt;/script&gt;
&lt;TITLE&gt;
        New Registration Form
    &lt;/TITLE&gt;&lt;/head&gt;

&lt;body&gt;
&lt;center&gt;
&lt;br&gt;
&lt;p style="font-weight: bold; font-size: 30"&gt;Please Fill Out Your Information Sheet&lt;/p&gt;&lt;p&gt;&lt;?php                      
                        echo date('F j, Y, g:i a', time()+25200);
                        ?&gt;&lt;/p&gt;
&lt;form method="POST" action="add.php"&gt;
&lt;!--&lt;input type="text" name="new_fname" class="Form-Control" placeholder="First Name" id="fname" required&gt;--&gt;
&lt;input type="text" name="new_fname" class="Form-Control" placeholder="First Name" id="fname" required&gt;
&lt;input type="text" name="new_mname" class="Form-Control" placeholder="Middle Initial" id="mname" required&gt;
&lt;input type="text" name="new_lname" class="Form-Control" placeholder="Last Name" id="lname" required&gt;&lt;br&gt;&lt;br&gt;
Select Your gender
&lt;select name="new_gender"&gt;
    &lt;option value=""&gt;&lt;/option&gt;
    &lt;option value="Male"&gt;Male&lt;/option&gt;
    &lt;option value="Female"&gt;Female&lt;/option&gt;
&lt;/select&gt;

Select Your Status

&lt;select name="new_status"&gt;
    &lt;option value=""&gt;&lt;/option&gt;
    &lt;option value="New"&gt;New&lt;/option&gt;
    &lt;option value="Old"&gt;Old&lt;/option&gt;
    &lt;option value="Transferee"&gt;Transferee&lt;/option&gt;
    &lt;option value="Shiftee"&gt;Shiftee&lt;/option&gt;
&lt;/select&gt;

Select Your Course

&lt;select name="new_course"&gt;
    &lt;option value=""&gt;&lt;/option&gt;
    &lt;option value="BSINFOTECH"&gt;BSINFOTECH&lt;/option&gt;
    &lt;option value="BSIS"&gt;BSIS&lt;/option&gt;
    &lt;option value="BSCOMTECH"&gt;BSCOMTECH&lt;/option&gt;
&lt;/select&gt;
&lt;br&gt;&lt;br&gt;
&lt;input type="text" name="new_age" class="Form-Control" placeholder="Age" id="age" required&gt;&lt;br&gt;&lt;br&gt;
&lt;input type="text" name="new_bp" class="Form-Control"  placeholder="Birth Place" id="bp" required&gt;&lt;br&gt;&lt;br&gt;
&lt;input type="text" name="new_add" class="Form-Control" placeholder="Address" id="add" required&gt;&lt;br&gt;&lt;br&gt;
&lt;input type="text" name="new_nat" class="Form-Control" placeholder="Nationality" id="nat" required&gt;&lt;br&gt;&lt;br&gt;
&lt;input type="text" name="new_rel" class="Form-Control" placeholder="Religion" id="rel" required&gt;&lt;br&gt;&lt;br&gt;
&lt;input type="text" name="new_tel" class="Form-Control" placeholder="Tel. No." id="tel" required&gt;&lt;br&gt;&lt;br&gt;
&lt;input type="text" name="new_cel" class="Form-Control" placeholder="Cel. No." id="cel" required&gt;&lt;br&gt;&lt;br&gt;
&lt;input type="text" name="new_mail" class="Form-Control" placeholder="E-mail Address" id="mail" required&gt;&lt;br&gt;&lt;br&gt;
    &lt;button onclick="parent.location='req.php'" type="submit" name="next"&gt;Next&lt;/button&gt;
&lt;button type="submit" class="btn" name="save" value="save"&gt;Save&lt;/button&gt;


&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>here is the req.php code:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;link rel="stylesheet" href="bootstrap/css/bootstrap.css"/&gt;
&lt;script type="text/javascript" src="jquery.js"&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="bootstrap/js/bootstrap.js"&gt;

&lt;/script&gt;
&lt;title&gt;
REQUIRMENTS FORM    
&lt;/title&gt;
&lt;br&gt;
&lt;p align="center" style="font-size: 50"&gt;REQUIRMENTS FORM&lt;/p&gt; 
&lt;/head&gt;
&lt;body&gt;
&lt;center&gt;
&lt;br&gt;
&lt;p align="center" style="font-size: 30"&gt;Registrar&lt;/p&gt;
&lt;form style="font-size: 20" action="add.php" method='post'&gt;
 Form 138
&lt;br&gt;
&lt;select name="form1"&gt;
&lt;option value=""&lt;/option&gt;
&lt;option value="Yes"&gt;Yes&lt;/option&gt;
&lt;option value="No"&gt;No&lt;/option&gt;
&lt;/select&gt;
&lt;br&gt;
Form 137A
&lt;br&gt;
&lt;select name="form2"&gt;
&lt;option value=""&lt;/option&gt;
&lt;option value="Yes"&gt;Yes&lt;/option&gt;
&lt;option value="No"&gt;No&lt;/option&gt;
&lt;/select&gt;
&lt;br&gt;
2 X 2 ID
&lt;br&gt;
&lt;select name="picture"&gt;
&lt;option value=""&lt;/option&gt;
&lt;option value="Yes"&gt;Yes&lt;/option&gt;
&lt;option value="No"&gt;No&lt;/option&gt;
&lt;/select&gt;
&lt;br&gt;
NSO Birth Certificate
&lt;br&gt;
&lt;select name="nso"&gt;
&lt;option value=""&lt;/option&gt;
&lt;option value="Yes"&gt;Yes&lt;/option&gt;
&lt;option value="No"&gt;No&lt;/option&gt;
&lt;/select&gt;
&lt;br&gt;
Good Moral Certificate
&lt;br&gt;
&lt;select name="gmc"&gt;
&lt;option value=""&lt;/option&gt;
&lt;option value="Yes"&gt;Yes&lt;/option&gt;
&lt;option value="No"&gt;No&lt;/option&gt;
&lt;/select&gt;
&lt;p align="center" style="font-size: 30"&gt;Library&lt;/p&gt;
Library Card
&lt;br&gt;
&lt;select name="lc"&gt;
&lt;option value=""&lt;/option&gt;
&lt;option value="Yes"&gt;Yes&lt;/option&gt;
&lt;option value="No"&gt;No&lt;/option&gt;
&lt;/select&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p align="center" style="font-size: 30"&gt;Cashier&lt;/p&gt;
&lt;p&gt;&lt;h4&gt;You should have paid minimum of P2000.00-2500.00&lt;/h4&gt;&lt;/p&gt;
&lt;input type="text" name="cashier" class="Form-Control" width="100px" placeholder="Enter amount" id="cashier" required&gt;&lt;/input&gt;
&lt;button type="submit" style="font-size: 20" class="btn btn-primary btn-block" name="submit" value="save"&gt;SUBMIT&lt;/button&gt;
&lt;button  type="button" style="font-size: 20" class="btn btn-primary btn-block"&gt;&lt;a href="newform.php?id=&lt;?php echo $data-&gt;new_id ?&gt;"&gt;Process Student Copy&lt;/button&gt;
&lt;input type="hidden" value="&lt;?php echo $data-&gt;new_id ?&gt;" name="id" &gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>here is the add.php code:</p>

<pre><code>&lt;?php
mysql_connect("localhost","root");
mysql_select_db("enrollee");
$course=$_POST['new_course'];
$gender=$_POST['new_gender'];
$gender=$_POST['new_gender'];
$status=$_POST['new_status'];
$fname=$_POST['new_fname'];
$mname=$_POST['new_mname'];
$lname=$_POST['new_lname'];
$age=$_POST['new_age'];
$bp=$_POST['new_bp'];
$add=$_POST['new_add'];
$nat=$_POST['new_nat'];
$rel=$_POST['new_rel'];
$tel=$_POST['new_tel'];
$cel=$_POST['new_cel'];
$mail=$_POST['new_mail'];
form1=$_POST['form1'];
$form2=$_POST['form2'];
$picture=$_POST['picture'];
$nso=$_POST['nso'];
$gmc=$_POST['gmc'];
$lc=$_POST['lc'];
$cashier=$_POST['cashier'];

mysql_query("INSERT INTO new(new_id,new_course,new_gender,new_status,new_fname,new_mname,new_lname,new_age,new_bp,new_add,new_nat,new_rel,new_tel,new_cel,new_mail,form1,form2,picture,nso,gmc,lc,cashier))
                VALUES(NULL, '$course','$gender', '$status', '$fname','$mname','$lname','$age','$bp','$add','$nat','$rel','$tel','$cel','$mail','$form1','$form2','$picture','$nso','$gmc','$lc','$cashier')");         
    header("Location: read.php");
    ?&gt;
</code></pre>