numRows($db->query($query)) >= 1) { $result = $db->fetchAll($db->query($query))[0]; if (password_verify($password, $result['password']) && $email == $result['username']) { // SUCCESS! $_SESSION['user'] = $result['id']; $_SESSION['username'] = $result['username']; $_SESSION['lvl'] = $result['level']; header('Location: index.php?page=news'); die("Error, please enable browser redirects."); } else { $error[] = "Mail wrong"; } } else { $error[] = "Wrong email or password."; header('Location: index.php?page=login&error=1'); } } /* * If no information was sent to the script, or the login was incorrect - HTML below here will be shown. */ header('Location: ' . Config::$sys_url . '?page=login&error=1'); die("Error, please enable browser redirects.");