Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] View losing CSS Style after login validation fails.
#1

[eluser]cdonate[/eluser]
So, this is the header of my login_view.php.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html xml:lang="en" lang="en"&gt;
    &lt;head&gt;
        &lt;title&gt;Login SINUS 2012&lt;/title&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;
        &lt;base href="&lt;?=base_url();?&gt;" /&gt;
        &lt;link rel="stylesheet" type="text/css" href="css/default2.css"/&gt;
    &lt;/head&gt;

My controller have this code in it:

Code:
&lt;?php

class Login extends CI_Controller{

function index(){
  $this->load->view('login_view');
}

function validate_credentials(){

  $this->load->model('membership_model');
  $query = $this->membership_model->validate();
  
  if($query){ //Se as credenciais forem validadas

   $data = array(
    'username' => $this->input->post('username'),
    'is_logged_in' => true
   );
   $this->session->set_userdata($data);
   $this->load->view('escolha_view');
  
  
  }else{
                       //$this->load->view('login_view');
         $this->index();
       }
}
When I point my browser to:
http://localhost/code/index.php/
the page is displayed without problem, the CSS Style and images are linked.

But, if I just click on Login, without typing my credentials the page loses all its styles and images.
After the failed authentication my browser points to:
http://localhost/code/index.php/login/va...redentials

I gess that that has something to do with it.

My base_url is set to http://localhost/code/, that is pointing to C:\wamp\www\code.

My css and img files are inside C:\wamp\www\code\css and C:\wamp\www\code\img.

Thanks for the help, guys!
#2

[eluser]Unknown[/eluser]
I made an account on here just to say THANK YOU! Big Grin Funny how the simplest of things can stump you for hours!




Theme © iAndrew 2016 - Forum software by © MyBB