I am trying to display an alert box using javascript in my login php file.
When a user logged in using a wrong username or password, then a messagebox will display.
This is what i have so far:
$query="SELECT * FROM info WHERE username ='$user' && password ='$pass' ";
$res=mysql_query($query);
if (mysql_num_rows($res) == 0) {
echo"<script language="javascript">window.alert('Invalid password.')</script>";
echo "<br>";
}
else {
echo "Access Granted";
echo "<br>";
}
Can't figure it out.