This question already has an answer here:
I have this code that checks for login. It has been working fine but just stopped working suddenly.
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;
}
}
After checking my apache error log, I am seeing this error:
PHP Fatal error: Cannot re-assign auto-global variable _POST
Any work around this?
</div>