Welcome Guest, Not a member yet? Register   Sign In
form/credentials validation
#1

[eluser]roguedogg[/eluser]
I'm having an issue getting this code right, it seems to be looping or something and causing my localhost to run out of memory. Can someone help by taking a look at this and recommending a fix. Here is the error I get:

Quote:Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65488 bytes) in C:\xampp\htdocs\prop_mgr\system\libraries\Form_validation.php on line 341

Controller:
Code:
public function validate_credentials(){
  
  $this->load->library('form_validation');
  $this->form_validation->set_rules('email', 'Email', 'required|xss_clean|callback_validate_credentials');
  $this->form_validation->set_rules('pword', 'Password', 'required|md5');
  
  if ($this->form_validation->run()){
  
  $this->load->model('users_model');
  $query = $this->users_model->validate();
  
  
  
   $data = array(
    'email' => $this->input->post('email'),
    'fname' => 'Yahoo',
    'is_logged_in' => TRUE
   );
  
   $this->session->set_userdata($data);
   redirect('main/members_area');
  } else {
   $this->form_validation->set_message('validate_credentials', 'Incorrect Email/Password');
   $this->index();
  }
}

Model:
Code:
public function validate(){
  $this->db->where('email', $this->input->post('email'));
  $this->db->where('pword', md5($this->input->post('pword')));
  $query = $this->db->get('users');
  
  if($query->num_rows == 1){
   return true;
  } else {
   return false;
  }
}


Messages In This Thread
form/credentials validation - by El Forum - 09-12-2012, 08:54 AM
form/credentials validation - by El Forum - 09-12-2012, 10:07 AM
form/credentials validation - by El Forum - 09-12-2012, 10:11 AM
form/credentials validation - by El Forum - 09-12-2012, 10:23 AM
form/credentials validation - by El Forum - 09-12-2012, 10:30 AM
form/credentials validation - by El Forum - 09-12-2012, 10:48 AM
form/credentials validation - by El Forum - 09-12-2012, 11:17 AM
form/credentials validation - by El Forum - 09-12-2012, 11:24 AM
form/credentials validation - by El Forum - 09-12-2012, 11:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB