[eluser]DavidHopkins[/eluser]
Thanks for your replies. All sorted now
Just a little bit off topic im also having some troubles with session data. Could you take a little look at this please?
My function looks like this
Code:
function checkLogin() {
$this->load->library('form_validation');
$this->form_validation->set_rules('email', 'Email Address', 'trim|required|valid_email|xxs_clean');
$this->form_validation->set_rules('password', 'Password', 'trim|required|xxs_clean');
extract($_POST);
if($this->form_validation->run()==False) {
$this->session->set_flashdata('login_error_email', $email);
$this->load->view('login_view');
}
else {
$fname = $this->Login_model->processLogin($email, $password);
if(! $fname) {
$this->session->set_flashdata('login_error', TRUE);
$this->session->set_flashdata('login_error_email', $email);
redirect('login');
}
else {
$this->session->set_userdata('loggedIn', TRUE);
$this->session->set_userdata('fname', $fname);
redirect('login/main');
}
}
}
The session is not bringing back data as i would expect. When the validation is not correct. I can output the error message on my page fine. However the $this->session->set_flashdata('login_error_email', $email); session dosent output anything on my page. However if i change $this->load->view('login_view'); to redirect('login'); the session shows the data, but the form validaiton messages dont appear then.
Any suggestions ?
Many Thanks
David Hopkins