title: CodeIgniter: I can't login
body: <p>I'm trying to make a login script in CodeIgniter, but I only have a blank page.</p>
  
  <p>I want it to say "username or password is wrong" and if the username and password is correct it should set session to true. I hope some one can help me.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  
  class Login extends Controller {
  
      function index()
      {
  
          if ($this-&gt;_submit_validate() === FALSE) {
              $this-&gt;index();
              return;
          }
  
  
      }
  
      private function _submit_validate()
      {
          $this-&gt;form_validation-&gt;set_rules('username', 'Username',
              'trim|required|');
  
          $this-&gt;form_validation-&gt;set_rules('password', 'Password',
              'trim|required');
  
          return $this-&gt;form_validation-&gt;run();
      }
  
  
      function is_logged_in()
      {
          $is_logged_in = $this-&gt;session-&gt;userdata('is_logged_in');
          if(!isset($is_logged_in) || $is_logged_in != true)
          {
              echo 'Du har ikke adgang til denne side';   
              die();      
              //$this-&gt;load-&gt;view('login_form');
          }       
      }
  
  }
  </code></pre>
  
  <p>And here is my view file:</p>
  
  <pre><code>        &lt;h3&gt;Medlem login&lt;/h3&gt;&lt;br&gt;
          &lt;?php
          echo form_open('login/');
          echo validation_errors('&lt;p class="error"&gt;');
          echo form_input('username', 'Username');
          echo form_password('password', 'Password');
          echo "&lt;br /&gt;";
          echo form_submit('submit', 'login');
          echo anchor('signup', 'Opret Account');
          echo form_close();
          ?&gt;
  </code></pre>