Hello,
I want to set a customer error message. Can anyone tell me why this doesn't it appear?
Thanks,
James
I want to set a customer error message. Can anyone tell me why this doesn't it appear?
Thanks,
James
PHP Code:
$this->form_validation->set_rules('username', 'Username', 'trim|required|xss_clean');
$this->form_validation->set_rules('password', 'Password', 'trim|required|xss_clean');
if ($this->form_validation->run() == FALSE) {
$this->load->view('register/header');
$this->load->view('register/researcher_form');
$this->load->view('footer');
} else {
$username = $this->input->post('username', TRUE);
$password = $this->input->post('password', TRUE);
// Check the username and password
$researcher_id = $this->user->researcher_login($username, $password);
if ($researcher_id == TRUE){
redirect("/register/study/");
} else {
$this->form_validation->set_message('login failed', 'Your username and password may be wrong.');
$this->load->view('register/header');
$this->load->view('register/researcher_form');
$this->load->view('footer');
}
}
}