Here is my code for 3 separate pages. It involves taking in user information for a company and then putting it int o their database. There is only one problem. On the first page I collect the information. On the second page I have the information displayed back to the viewer asking them if the information is correct please click the next button. On the third page I want it to then put the information that is correct off the second page into the Database. Every page works, its just it puts an empty row into my database, which means that the information I am trying to put in is not really there. Here is the code for the 3 pages.
First Page Code: Basic Form
Fields:
First Name
Last Name
Email
etc....
Second Page (taking in the form informatino and displaying it so the user can go back and make any changes if necessary). On this page I displayed the information into a table for the user to see, that is why i created the variables.:
if (!get_magic_quotes_gpc()) {
$POST['username'] = addslashes($POST['username']);
}
$usercheck = $POST['username'];
$check = mysql_query("SELECT username FROM ld_user_information WHERE username = '$usercheck'") or die(mysql_error());
$check2 = mysql_num_rows($check);
$email = $REQUEST['email'];
//if the name exists it gives an error
if ($check2 != 0)
{
die('Sorry the username '.$POST['username'].' is already in use. Please try another one.');
}
else{
// this makes sure both passwords entered match
if ($POST['password'] != $POST['confirm_password'])
{
die('Your passwords did not match.');
}
else
{
$firstname = $REQUEST['firstname'];
$lastname = $REQUEST['lastname'];
$email = $REQUEST['email'];
$company = $REQUEST['company'];
$number = $REQUEST['number'];
$address = $REQUEST['address'];
$city = $REQUEST['city'];
$state = $REQUEST['state'];
$zipcode = $REQUEST['zipcode'];
$country = $REQUEST['country'];
$username = $REQUEST['username'];
$password = $_REQUEST['password'];
Third Page Code:
(I am essentially trying to take the information displayed on page 2 from the variables requesting the form data and inserting that into the DB, so passing the information over 2 pages):
I am not sure how to code the third page.
Much help with the correct way to pass the data would be great. Thanks