我有這個代碼來檢查登錄。它一直工作正常,但突然停止工作。
public function checkLogin($_POST) {
// fetching user by email
$stmt = $this->conn->prepare("SELECT password_hash FROM users WHERE email = ?");
$stmt->bind_param("s", $email);
$stmt->execute();
$stmt->bind_result($password_hash);
$stmt->store_result();
if ($stmt->num_rows > 0) {
// Found user with the email
// Now verify the password
$stmt->fetch();
$stmt->close();
if (PassHash::check_password($password_hash, $password)) {
// User password is correct
return TRUE;
} else {
// user password is incorrect
return FALSE;
}
} else {
$stmt->close();
// user not existed with the email
return FALSE;
}
}
檢查我的Apache的錯誤日誌後,我看到這個錯誤:
PHP Fatal error: Cannot re-assign auto-global variable _POST
任何解決此問題?
你有沒有突然* *更新到新版本的PHP? :) –
正如你不'''電子郵件'或'$密碼'''$ _POST'我沒有看到這個功能可以如何工作 – RiggsFolly