Page 1 of 1

Problems with if help

Posted: Mon Aug 24, 2009 10:18 am
by reddurango
Hello i have a problem with this if, i'm trying to make it work but the else sentence doesn't work, when the condition is true it works but when its false it doesn't 'cause it doesn't show anything it leaves the page blank. Please help.

Code: Select all

$user = $_POST ["usuario"];
$pass = $_POST ["password"];
 
$result = mysql_query("SELECT * FROM clientes
WHERE clientes_correo='{$user}';");
 
while ($row = mysql_fetch_array($result))
{
if ($pass==$row['clientes_password'])
    {
    echo "Tus datos son correctos da click para continuar <br/>";
    $_SESSION['usuario']=$user;
    $_SESSION['nombre']=$row['clientes_nombre'];
    echo "<a href=index.php>Continuar";
    }
    elseif ($pass!=$row['clientes_password'])
        {
    echo "Tus datos son incorrectos da click para continuar";
    echo "<a href=index.php>Continuar";
}
    else
    echo "Error: Intente Nuevamente";
}
?>

Re: Problems with if help

Posted: Mon Aug 24, 2009 11:57 am
by highjo
hello how do you know the $pass has the value you are checking for?one step to find out what is happening is to print the value of $pass and each value of $row['clientes_password']; hope this helps you find out what is wrong