Xtremer360 Posted August 24, 2012 Share Posted August 24, 2012 I'm trying to figure out why I'm getting a Fatal error: Can't use method return value in write context in /home/xtremer/public_html/kowmanager/app/controllers/login.php on line 101 error. Line 101 is [code=php:0] if (isset($this->session->userdata('failed_logins'))) /** * Checks to see if the max number of attempts have been exceeded. * * @param string $post_username Posted value of a username field. * @return boolean TRUE/FALSE Depends on if login attempts have been exceeded or not. */ private function is_max_failed_login_attempts_exceeded($post_username) { if (isset($this->session->userdata('failed_logins'))) { if ($this->session->userdata('failed_logins') == $this->config->item('failed_login_limit')) { $this->users_model->lock_out_user($post_username, date('Y-m-d H:i:s', $this->config->item('wait_time'))); return TRUE; } $this->session->userdata('failed_logins')++; return FALSE; } else { $this->session->userdata('failed_logins') == 1; return FALSE; } } Link to comment https://forums.phpfreaks.com/topic/267541-cant-use-method-return/ Share on other sites More sharing options...
Adam Posted August 24, 2012 Share Posted August 24, 2012 isset and empty both check that a variable, array index or property exist; something defined. They can't do that if you're trying to pass in a returned value. Link to comment https://forums.phpfreaks.com/topic/267541-cant-use-method-return/#findComment-1372223 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.