Error: wrong username or password x10
Posted: Sun Apr 18, 2004 2:29 pm
Hi!
I have login script here, but the problem is when I enter invalid username or password I get this:
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
My code is this:
How can I make Invalid User Name or Password display only once?? I try Break; but then It stops searching after the first username! Can you please help me? thank you!
I have login script here, but the problem is when I enter invalid username or password I get this:
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
Invalid User Name or Password
My code is this:
Code: Select all
<?
$username = $_POST["txtusername"];
$password = $_POST["txtpassword"];
$db = mysql_connect('localhost','root','mypass') ;
mysql_select_db("database")
$result = mysql_query("SELECT * FROM users");
while($results = mysql_fetch_array($result)){
if ($results['username'] == $username && base64_decode($results['password']) == $password) {
echo "You are loged in successfully";
}
else
{
echo "Invalid User Name or Password";
}
}
?>