Jump to content

Validation Problem


purtip3154

Recommended Posts

Here's the part of the code that I've been having problems with:

 

while (odbc_fetch_row($rs))
{
$uname=odbc_result($rs,"Username");
$pword=odbc_result($rs,"Password");
if($_POST["user"] == $uname){
if($_POST["pass"] == $pword){
echo $b1.$hed1."<font color='aqua'>Correct login, what would you like to do next?:</font><br /><ul><li><a href='http://localhost/proj/addre.php'>Check Addresses</a></li><li><a href='http://localhost/proj'>Go Back!</a></li></ul>".$e1;
break;
}elseif ($_POST["user"] && $_POST["pass"]){
echo $b1.$hed1."<font color='red'><b>Invalid username and/or password!</b></font><br /><br />".$f1.$e1;
break;
}
}
}

 

When you type in a correct username, and the incorrect password, it shows the invalid u/p message, but when you type in an incorrect username, and a correct or incorrect password, then it just shows a blank screen. Is there some way to do this that if you have the wrong username, it shows the error message too?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.