[eluser]BrainCatcher[/eluser]
Hi everybody! I'm new here and determent to learn alot!! I'm not new to PHP , but using Codeigniter for the first time, and the MVC end OO structure.
Just made a login system, and the tuts are great!! Even thinking about an plus account.
I run into a problem that is driving me nuts....
Message: Undefined property: Login::$authenticate_model
controller login.php
Code:
<?php
class Login extends Controller{
function index(){
$this->load->view('includes/header');
$this->load->view('login_form');
$this->load->view('includes/footer');
}
function inloggen()
{
$this->load->model('authenticate_model','authenticate_model');
$query = $this->authenticate_model->user_validate();
if ($query){
$data = array(
'username' => $this->input->post('username'),
'is_logged_in' => true
);
$this->session->set_userdata('$data');
redirect('site');
}
else{
$this->index();
}
}
}
?>
Model file authenticate_model.php
Code:
<?php
class Authenticate_model extends Model {
function user_validate()
{
$this->db->where('fld_username', $this->input->post('username'));
$this->db->where('fld_password', $this->input->post('password'));
$query = $this->get('tbl_werknemers');
if ($query->num_rows() == 1){
return true;
}
}
}
?>
config.php
Code:
$config['base_url'] = "http://localhost/ci172/";
autoload.php
Code:
$autoload['libraries'] = array('database', 'session');
$autoload['helper'] = array('url','form');
Any help is appreciated. The above code is developed with version CI 1.7.2.
Thanks in advance
Grtz BrainCatcher