[eluser]sorenchr[/eluser]
Hi there! Im new to CodeIgniter, so far it's a thrill to use, however I can't seem to figure out how to exit on an if-statement inside a controller function. I have this code:
Code:
function auth() {
//If no submit post-data is send, give error
if(!$this->input->post('username') || !$this->input->post('password')) {
$data['error'] = "true";
$this->output->set_output($this->load->view('login_view', $data));
}
//$this->load->model('gatekeeper');
$query = "true"; // $this->gatekeeper->auth();
if($query) {
$data['error'] = "false";
$this->output->set_output($this->load->view('login_view', $data));
} else {
$data['error'] = "true";
$this->output->set_output($this->load->view('login_view', $data));
}
}
The $query = "true" bit is just there to test the code. Well, the page goes blank, which it shouldn't, it should either send $error = true or false on to the login_view. How do I do that?
Thanks for your time!