just remove the else part of the main if statement and the password confirmation part placed in the main if statement:
if ($_SERVER["REQUEST_METHOD"] == "POST") { some coce } //"""" else { if($password != $pass_conf){ $passMathErr= "Passwords do not match. Please, go back and re-enter the passwords!"; // die($passMathErr); } else{ $sql="insert into users values('$userID', '$password', '$firstName', '$lastName', '$middle', '$address', '$city', '$state', '$zip', '$email', '$phone')"; $result=mysql_query($sql, $connection); header("Location:login.html"); } } //""" if ($_SERVER["REQUEST_METHOD"] == "POST") { some coce } //"""" else { if($password != $pass_conf){ $passMathErr= "Passwords do not match. Please, go back and re-enter the passwords!"; // die($passMathErr); } else{ // perform sql query to insert the data $sql="insert into users values('$userID', '$password', '$firstName', '$lastName', '$middle', '$address', '$city', '$state', '$zip', '$email', '$phone')"; $result=mysql_query($sql, $connection); header("Location:login.html"); } } //""" // perform sql query to insert the data
delete the above part "" and add it inside the main if statement
pradeep
source share