Welcome Guest, Not a member yet? Register   Sign In
CI can't find my method and I don't know why...
#1

Hi all, I have a project in Ci and I can't get it to recognize my check2() for some reason. CI keeps throwing Fatal error: Call to undefined method CI_Loader::check2()

controller (Login.php)
PHP Code:
class Login extends CI_Controller {
    
    public function 
index() {
        
// Page variables
        
$page['title'] = "Analytics Login";      
        
$this->load->view('header'$page);    
        
$this->load->view('login');
        
$this->load->view('footer');
    }
  
    public function 
verify() {
        
        
$verifier     $this->load->model('Verifylogin_model');
        
        
$username $this->input->post('username');
        
$password $this->input->post('password');
        
        if((!
$verifier->check2($username,$password))) {
            
$this->load->view('login');
        } else {
            
redirect('home''refresh');    
        }
    }


Model (verifylogin_model.php)
PHP Code:
<?php
Class Verifylogin_model extends CI_Model {
    
    function 
__construct() {
        
parent::__construct();
    }

    public function 
check2($username$password) {
        
        
$this->db->select('user_id, user_email');
        
$this->db->from('admin_users');
        
$this->db->where('user_email'$username);
        
$this->db->where('user_pass'md5($password));
        
$this->db->limit(1);
        
        
$results $this->db->get();
    
        if (
$results->num_rows() == 1) {
            return 
true;
        } else {
            return 
false;
        }
    }
}
?>


Any feedback is welcome
Reply


Messages In This Thread
CI can't find my method and I don't know why... - by chidiplomat - 10-05-2015, 11:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB