hello guys .. here i go again .. i'm having a problem with my registration form .. my reg. form has 'password' field and 'confirm password' password field .. now i want to compare if the 2 passwords are entered the same but it doesn't seem to work .. its always saying that passwords does not match even if it really does .. i'm using the traditional 'if' statement and tried almost all possible ways on how to solve this problem but to no avail .. do i have to use special function to compare passwords ? ..
mysql_connect('localhost' , 'root' , '');
mysql_select_db('login_db');
$user=$_POST["user"];
$pass=$_POST["pass"];
$pass2=$_POST["pass2"];
$title=$_POST["title"];
$name=$_POST["name"];
$add=$_POST["add"];
$email=$_POST["email"];
$query = "insert into members (username , password , title , name , address , email) values ('{$user}' , '{$pass}' , '{$title}' , '{$name}' , '{$add}' , '{$email}' )";
if(empty($user) || empty($pass) || empty($pass2) || empty($title) || empty($name) || empty($add) || empty($email))
{
include "signup_form.php";
echo "<br><br><center>Please Fill Out Empty Fields ....";
}
elseif($_POST["pass"] != $pass2)
{
include "signup_form.php";
echo "<br><br><center>Passwords Does Not Match ...";
}
elseif(@mysql_query($query))
{
include "confirm.php";
}
else
{
echo "<br><br><center>ERROR !!!";
}
mysql_close();
?>
THANKS IN ADVANCE ..