I'm trying this code to check if a user is verified and redirecting them if they are not. I'm having trouble with the result as it keeps redirecting me regardless of if I am verified or not. Here is the code:
<?php
if(loggedin()){
$check_active_sql = mysql_query("SELECT * FROM members WHERE username = '$username'") or die(mysql_error());
while ($check_active_res = mysql_fetch_array($check_active_sql)) {
$active = $check_active_res['active'];
if($active == "0"){
header("Location: login.php?verify=true");
}
else
{
}
}
};
?>
Thank you