我的login.PHP页面返回空白。我试图改变我能想到的一切。我知道我可能只是缺少一些简单的东西。它应该会返回错误。下面是login.php中的代码(我也打开一个单独的错误报告,看看我得到了什么错误,我越来越“阵列()”的时间提前Login.php返回空白
include 'core/init.php';
if (empty($_post) === false){
$username = $_post['username'];
$password = $_post['password'];
if (empty($username)=== true || empty($password) === true) {
$errors[] = 'You need to enter a username and password.';
}
else if (user_exists($username) ===false) {
$errors[] = 'We can\'t find that username. Have you registered?';
}
else if (user_active($username) ===false){
$errors[] = 'You haven\'t activate your account yet.';
}
}
print_r($errors);
ini_set('display_errors',1);
error_reporting(E_ALL);
谢谢!
可能我建议,而不是'如果(空($ _ POST)===˚F alse)'你写'if(!empty($ _ POST))等等,它更可读。和大写'$ _POST' – 2013-03-11 23:04:55
或只是'if($ _post)' – 2013-03-11 23:07:12