when type in wrong username and password and press submit it only display “1” instead of displaying "wrong username and password "
//query database to get information.
$query = mysql_query(“SELECT * FROM data_time WHERE username = '”.$username.“’ AND password = '”.$password."’ ")or die(mysql_close());
$res = mysql_num_rows($query)or die(mysql_close());
if ($res > 0){
$_SESSION[‘username’] = $_POST[‘username’];
header(‘Location: profile.php’);
die();
}else{
echo “Wrong username and password”;
die();
}
Of course none of the mysql_ calls will work when the PHP version on the server is next upgraded as that interface was deleted from PHP earlier this month.
Yes, @Gandalf had already mentioned that so I didn’t want to labour the point. I can only assume OP is in charge of their server versions and will plan ahead to suit.