title: CodeIgniter form_validation not working properly
body: <p>I am new to php. My setup is lamp on ubuntu 14.04 LTS.
  I have created a Login system with the help of online tutorials.
  I have already made changes in <code>autoload.php</code> file as</p>
  
  <pre><code>$autoload['libraries'] = array('database', 'form_validation');
  $autoload['helper'] = array('url', 'form');
  </code></pre>
  
  <p>Unexpectedly, when both the username and password fields are left empty, and Login button is pressed, <strong>no</strong> errors (that 'Username field is empty'...)are displayed.
  Moreover, in Mozilla Firefox the page remains the same on pressing the button
  and in Google Chrome, the page loads to about:blank .</p>
  
  <p>Please help and sorry if i made a mistake in the question format.</p>
  
  <p><strong>My controller: LoginController.php</strong></p>
  
  <pre><code>&lt;?php
  
  class LoginController extends CI_Controller{
  
  public function index(){
  
      $this-&gt;load-&gt;view('login');
  }
  
  public function checkLogin(){
      $this-&gt;load-&gt;library('form_validation');
      $this-&gt;form_validation-&gt;set_rules('username' , 'Username' , 'required|valid_email');
      $this-&gt;form_validation-&gt;set_rules('password' , 'Password' , 'required|callback_verifyUser');
  
      if($this-&gt;form_validation-&gt;run() == false){
          $this-&gt;load-&gt;view('login');
  
      }else{
          redirect('HomeController/index');
      }
  
  }
  public function verifyUser(){
      $name = $this-&gt;input-&gt;post('username');
      $pass = $this-&gt;input-&gt;post('password');
  
      $this-&gt;load-&gt;model('LoginModel');
  
      if($this-&gt;LoginModel-&gt;login($name, $pass)){
          return true;
      }
      else{
          $this-&gt;form_validation-&gt;set_message('verifyUser', 'Incorrect email or password. Please try again.');
          return false;
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>My view file: login.php</strong></p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;CI Login System&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h1&gt;Login&lt;/h1&gt;
          &lt;?php echo validation_errors(); ?&gt;
          &lt;?php echo form_open('LoginController/checkLogin'); ?&gt;
          Username&lt;br/&gt;
          &lt;input type="text", name="username"/&gt;&lt;br/&gt;
          Password&lt;br/&gt;
          &lt;input type="text", name="passsword"/&gt;&lt;br/&gt;
          &lt;input type="submit", value="Login", name="submit"/&gt;
          &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>