CodeIgniter Forums

Full Version: Unsuccessful Login
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am new to codeIgniter but I am facing a challenge with login functions.
Look at the code below and advice; This is my logincontroller
    class Logincontroller extends CI_Controller{
        public function index(){
        public function checklogin(){
            $this->form_validation->set_rules('username', 'Username', 'required');
            $this->form_validation->set_rules('password', 'Password', 'required|callback_verifyuser');
        if ($this->form_validation->run()==false) {

        public function verifyuser(){


            if($this->loginmodel->login($username,$password)) {
                  return true;
                $this->form_validation->set_message('verifyuser', 'Incorrect Username or Password. Please try again');
                return false;
I use correct login details but it returns this error message "I 'Incorrect Username or Password. Please try again'
Any advice
If the username/password are indeed correct your $this->loginmodel->login() are broken.