Ok I had a problem earlier knowing the code to type with the information separated over 3 pages. This is what I have now for the 3 pages, and it doesnt put anything into the database at the end. I know there has to be something im not putting in or else it would work.
Page 1:
<form action="page2.php" method="post">
<input name="firstname"
<input name="lastname"
etc....
</form>
Page: 2
<?php
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.');
}
// this makes sure both passwords entered match
if ($POST['password'] != $POST['confirm_password'])
{
die('Your passwords did not match.');
}
$SESSION['firstname'] = $POST['firstname'];
$SESSION['lastname'] = $POST['lastname'];
$SESSION['email'] = $POST['email'];
$SESSION['company'] = $POST['company'];
$SESSION['number'] = $POST['number'];
$SESSION['address'] = $POST['address'];
$SESSION['city'] = $POST['city'];
$SESSION['state'] = $POST['state'];
$SESSION['zipcode'] = $POST['zipcode'];
$SESSION['country'] = $POST['country'];
$SESSION['username'] = $POST['username'];
$SESSION['password'] = $POST['password'];
?>
Here i have a form displaying the information to the viewer to make sure it is correct.
<form method="post" action="page3.php">
<input type="hidden" name="firstname" value="<?php echo $_POST['firstname']; ?>">
<input type="hidden" name="lastname" value="<?php echo $_POST['lastname']; ?>">
<input type="hidden" name="email" value="<?php echo $_POST['email']; ?>">
<input type="hidden" name="company" value="<?php echo $_POST['company']; ?>">
<input type="hidden" name="address" value="<?php echo $POST['address']; ?>">
<input type="hidden" name="city" value="<?php echo $POST['city']; ?>">
<input type="hidden" name="state" value="<?php echo $POST['state']; ?>">
<input type="hidden" name="country" value="<?php echo $POST['country']; ?>">
<input type="hidden" name="zipcode" value="<?php echo $POST['zipcode']; ?>">
<input type="hidden" name="username" value="<?php echo $POST['username']; ?>">
<input type="hidden" name="password" value="<?php echo $_POST['username']; ?>">
<input type="submit" name="submit" value="Checkout">
</form>
Page3:
<?php
mysql_query("INSERT INTO ld_user_information (street_address, city, state, zipcode, country, lastname, firstname, company, number, email, username, password)
VALUES ('".$POST['address']."', '".$POST['city']."', '".$POST['state']."', '".$POST['zipcode']."', '".$POST['country']."', '".$POST['lastname']."', '".$POST['firstname']."', '".$POST['company']."', '".$POST['number']."', '".$POST['email']."', '".$POST['username']."', '".$POST['password']."')");
?>
For some reason it does not put the information into the database.
And after a couple hours of trying new things, I have no idea why.