I am trying to verify a user name and password in my headers to decide which page they will go too. I have this code-
$Query = "SELECT count(*) from $TableName where user_logname='$name' AND user_password='$password'";
$Result = mysql_db_query($DBName, $Query, $Link);
$count=mysql_result($Result,0,0);
if($count==1){
header("Location:myaccount.php");}
else{
header("Location:login.php");}
The problem is that if you type in the right login name, it enters my account even if the password is left blank or wrong. I can't understand why its letting them in myaccount when they don't enter the right password because I put where user_logname='$name' AND user_password='$password', with that statement, it doesn't seem possible for them to enter the account with the wrong password. Anyone have any ideas? Or maybe a different way to code that?
Thanks a lot for any help.