Below if part of my login script. I am trying to get it to redirect if the users account status is 'not verified' or 'suspended' (not verified is the field 'verified' = 0 and suspended is 'verified' = 2)
I'm sure it could be coded a little more eloquently, but this is what I have...anyone see why its not redirecting for non-verified/suspended users? (It does, however, redirect to the other pages(change.php and my.php) without a problem.)
$sql="SELECT * FROM users WHERE username='$myusername' and password='$mypassword'";
$result=mysql_query($sql);
$info = mysql_fetch_array($result, MYSQL_ASSOC);
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
if ($info['verified'] == 0) {
$url = "notverified.php";
$redirect = "other";
}
if ($info['verified'] == 2){
$url = "suspended.php";
$redirect = "other";
}
if ($myusername == "10001" && !($redirect == "other"))
{$url = "change.php";
}
if (!($myusername == "10001") && !($redirect == "other"))
{$url = "my.php";
}
session_register("myusername");
session_register("mypassword");
}else
{$url = "login.php";}
echo("<script>
<!--
location.replace(\"".$url."\");
-->
</script>");