When the user is banned it should echo out the banned echo but instead it echo\'s out the Failed login echo, Somewhere along the line I\'ve messed something up if someone could
I think it must be
if ($status[0] == 1) {
// code
}
place this line outside if
block
$SQL = $odb->prepare("SELECT `status` FROM `users` WHERE `username` = :username");
$SQL->execute(array(':username' => $username));
$status = $SQL->fetchColumn(0);
and in else part whaich says login failed do this
else // else for login failed
{
if($status == 1)
{
$SQL = $odb->prepare("SELECT `reason` FROM `bans` WHERE `username` = :username");
$SQL->execute(array(':username' => $username));
$ban = $SQL->fetchColumn(0);
echo '<center><div class="alert alert-icon alert-danger alert-dismissible fade in" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><i class="mdi mdi-check-all"></i>You are banned for Reason...</div></center>';
die('<span style="color:red;">You are banned. Reason:</span> ' . htmlspecialchars($ban));
}
echo '<center><div class="alert alert-icon alert-danger alert-dismissible fade in" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><i class="mdi mdi-check-all"></i>Login Failed!!</div></center>';
}
you also tried to print that banned for valid users too