title: CodeIgniter _Callback Username & Password Messages
body: <p>I am having a bit of an issue with my _callback function:</p>
  
  <p>What I am trying to achieve with the below code is that:</p>
  
  <ul>
  <li>If that the user details are not correct it shows the <code>$message</code> error (Does not currently show)</li>
  <li>If nothing has been entered and submit has been entered I would like it to display "Please Login".</li>
  </ul>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>public function loginUser() {
      $this-&gt;form_validation-&gt;set_rules('userEmail','Username', 'required|valid_email|trim|max_length[99]|xss_clean');
      $this-&gt;form_validation-&gt;set_rules('userPassword','Password', 'required|trim|max_length[200]|xss_clean|callback__checkUsernamePassword');
  
      if($this-&gt;form_validation-&gt;run() === TRUE) {
  
      }
  }
  </code></pre>
  
  <p><strong>Callback:</strong></p>
  
  <pre><code>function _checkUsernamePassword() {
      $username = $this-&gt;input-&gt;post('userEmail');
      $password = $this-&gt;input-&gt;post('userPassword');
      $user = $this-&gt;user_model-&gt;check_login($username,$password);
  
      if(! $user)
      {
          $data['contentMangement'] = $this-&gt;options_model-&gt;systemOptions();
          $data['pageTitle'] = 'Add User';
          $data['message'] = form_error('userEmail','&lt;div class="alert alert-error"&gt;', '&lt;/div&gt;'); 
          $this-&gt;load-&gt;view('_assets/header', $data);
          $this-&gt;load-&gt;view('addUser', $data);
          $this-&gt;load-&gt;view('_assets/footer');
          $this-&gt;form_validation-&gt;set_message('_checkUsernamePassword', 'Sorry %s is not correct.');
          return FALSE;
      }else{
          echo 'sheepdogs';
          return TRUE;
      }
  }
  </code></pre>