Codeigniter callback function not working
codeigniter, php, validation
Solution
It will return `TRUE` because
- You are not passing `email` and `password` to 'validate_login()'.
- So `$this->form_validation->run()` will not work.
move `validate_login()` to any controller
Problem
I am facing this problem from yesterday and can not fix it. My callback function is not working. It's always returning TRUE, but i don't know why? Can anyone help me? Here is the the model: ``` class Login_model extends CI_Model { public function check_login($str) { $this->form_validation->set_message('check_login', 'Error'); return FALSE; } function validate_login() { $this->form_validation->set_rules('email', 'Email Address', 'trim|required|valid_email|xss_clean'); $this->form_validation->set_rules('password', 'Password', 'callback_check_login'); if($this->form_validation->run() == FALSE) { return FALSE; } return TRUE; }} ``` The callback function should never return TRUE. But it's returning! I am going to die with this problem! :@