hello,
i have a serious problem :S
i have 4 pages
1st page: user enters his first, middle and last name. + a submit button to the 2nd page
2nd page: he enters his Gender, Age and Marital status. + a submit button to the 3rd page
3rd page: Address, City and Country + a submit button to the 4th page
4th page: he is asked some questions, + a submit button to insert data into Database
The problem is that the data is entered to db, after loading page 4, and not when clicking the submit button. So the data entered in page 4 are not entered to db
so what could i do to resolve this problem :(
plz help
This is the code of page4.php:
<?php
session_start();
$Fname = $_SESSION['fname'];
$Mname = $_SESSION['mname'];
$Lname = $_SESSION['lname'];
$Gender = $_SESSION['gender'];
$Age = $_SESSION['age'];
$Mstatus = $_SESSION['mstatus'];
$Address = $_SESSION['address'];
$City = $_SESSION['city'];
$Country = $_SESSION['country'];
?>
<html>
<head><title> Registration page four </title></head>
<body>
<?php
// insert data to db
?>
<form name="page4form" method="post" action="registered.php">
<p> In order to register to our website, you should fill this information: </p>
<table width ="500" border ="0" cellpadding = "2" cellspacing ="0">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td width="200">a. Do you smoke?</td>
<td>
<input name="smoke" type="radio" id="smoke" value="Y">yes<br>
<input name="smoke" type="radio" id="smoke" value="N">No<br>
</td>
</tr>
<tr align="center">
<td colspan="2"><input name="submit" type="submit" value="Register"></td>
</tr>
</table>
</form>
</body>
</html>