[eluser]Unknown[/eluser]
Hello all,
I have this issue with a view that comes up as a 404 error. I am working on login authentication and I was doing really well until this problem. Basically what I do is get the information from a form, compare it to the DB and is there is a match I show a view. This view is the one the will not work. Here is the code:
My controller:
Code:
class Login extends CI_Controller {
function index() {
$data['main_content'] = 'login_form';
$this->load->view('includes/template', $data);
}
function validate_credentials() {
$this->load->model('authentication_model');
$authentication = $this->authentication_model->validate();
if($authentication) {
$data = array(
'username' => $this->input->post('username'),
'authenticated' => true
);
$this->session->set_userdata($data);
redirect('application/main');
}
else {
$this->index();
}
}
}
The varianble $authentication does get set to true so I redirect to the application.php controller which looks like this:
Code:
class Main extends CI_Controller {
function main () {
$this->load->view('application_view');
}
}
And the application_view.php which looks like this:
Code:
This is the members only area!
Any help will be greatly appreciated.