if($suspended) {
die("suspended");
break;
}
break means that script should jump out of a loop and continue,
for example jump out of foreach, for, while
if you have die() ..(= exit())
then 'break' does not make sense
I am not sure this will solve your problem, probably not,
but remove that break; anyway
by using the 'php' bccode tag we can put some colours to your code
$login_user = $_POST['user'];
$login_pass = $_POST['pass'];
if($_POST['remember'] == "on") set_cookie("ln_username", $login_user, "month");
if($_POST['remember'] == "on") set_cookie("ln_password", $login_pass, "month");
$user_db = file("./data/users.php");
foreach($user_db as $user_db_line)
{
if(!eregi("<\?",$user_db_line)){
$col = explode("|",$user_db_line);
if(strtolower($col[1]) == strtolower($login_user) && $col[2] == $login_pass)
{
$file = file($UsersFile);
$suspended = false;
foreach($file as $db) {
$a2 = explode("|", $db);
$now = time();
if($a2[5] <= $now) {
$file = file($UsersFile);
$line = 0;
while($file[$line]) {
$a = explode("|", $file[$line]);
if ($a[1] == $user) {
$a[5] = "";
$file[$line] = implode($a, "|");
}
$line++;
}
$a = implode($file, "");
$fp = fopen($UsersFile, "w");
fwrite($fp, $a);
fclose($fp);
$suspended = false;
}
else {
$suspended = true;
}
}
if($suspended) {
die("suspended");
break;
}
else {
$_SESSION['logged_in'] = true;
$_SESSION['username'] = $col[1];
$_SESSION['level'] = $col[0];
header("Location: index.php");
break;
}
}
else echo("".W_PASS."<br>".BACK."");
} else echo "ERROR";
}