I'm new in CI, I have an input post named email and password in accounts controller like this:
$this->load->library('form_validation');
$this->load->library('auth');
$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
$this->form_validation->set_rules('password', 'Password', 'trim|required|min_length[12]');
if ($this->form_validation->run() === TRUE) {
$email = $this->input->post('email');
$password = $this->input->post('password');
$remember = $this->input->post('remember');
if($this->auth->login($email, $password, $remember)){
Meanwhile in my auth library i access the params like this:
public function login($email, $password, $remember)
{
$user = $this->CI->user_model->by_email($email);
$user_id = $user['id'];
if ($user) {
if (password_verify($password, $user['password'])) { //login succeed}
But i'm getting an error it said Message: Undefined index: password. i test the input post and it work fine and i don't spell wrong or something. so what do i miss here? for more information i'm sending this using Ajax.