[eluser]drseuss[/eluser]
Hi... Every time I run the page, and it gets to loading the login_model I get a 500 internal server error... and when I comment out the load->model it doesn't error.
here are the pages
login.php - controller
Code:
class Login extends CI_Controller {
function index() {
$this->load->view('login');
}
function verify() {
$this->load->model('login_model');
$query = $this->login_model->verify_credentials();
$query = true;
if($query) {
$session_data = array(
'email'=>$this->input->post('email'),
'is_logged_in'=>true
);
$this->session->set_userdata($session_data);
redirect('game');
} else {
$this->index();
}
}
}
login_model.php - model
Code:
class Login_model extends Model {
function verify_credentials() {
$this->db->where('email',$this->input->post('email'));
$this->db->where('password',$this->input->post('password'));
$query = $this->db->get('accounts');
if($query->num_rows == 1) {
return true;
}
}
}