[eluser]versatek[/eluser]
The main page of my site is a login form and the CSS loads just fine. Once the user enters the wrong credentials, the login page loads again and it displays the errors. Problem: when the login form loads for the second time the CSS does not load. Here is my code:
Code:
public function login_validation()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('email', 'Email', 'required|trim|xss_clean|callback_validate_credentials');
$this->form_validation->set_rules('password', 'Password', 'required|md5');
if($this->form_validation->run()){
//setting the session right below...
$data = array(
'email'=>$this->input->post('email'),
'is_logged_in'=>1
);
$this->session->set_userdata($data);
redirect('main/members');
}
else{
$this->load->view('login'); //unsuccessful login. Loads the view without CSS
}
}
public function validate_credentials()
{
$this->load->model('model_users');
if($this->model_users->can_log_in()){
return true;
}
else{
$this->form_validation->set_message('validate_credentials','Incorrect username/password.
Also, your account may not be active yet');
return false;
}
}
Please let me know. Thanks for your help.