In this code when i enter wrong password in the login panel it shows me the error "Your Account is deactivated by admin. Please contact Admin" but it should show the "Your Mobile or Password is invalid. Login Again!" is there any mistake in the if condition please anyone help me regarding this.
<?php
include("../includes/db.php");
session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
// username and password sent from form
$mobile = mysqli_real_escape_string($con,$_POST['mobile_l']);
$mypassword = mysqli_real_escape_string($con,$_POST['password']);
$sql = "SELECT * FROM agent_profile WHERE mobile = '$mobile' and password = '$mypassword'";
$result = mysqli_query($con,$sql);
$row = mysqli_fetch_array($result,MYSQLI_ASSOC);
$count = mysqli_num_rows($result);
$status = $row['status'];
// If result matched $myusername and $mypassword, table row must be 1 row
if($count == 1 && $status==1) {
$_SESSION['login_user'] = $mobile;
header("location: donor_list.php");
}
elseif($status==0)
{
$error="Your Account is deactivated by admin. Please contact Admin";
}
else {
$error = "Your Mobile or Password is invalid. Login Again!";
}
}
?>