title: How to disable direct access to callback functions?
body: <pre><code>&lt;? if ( ! defined('BASEPATH')) exit();
  
      class Registration extends CI_Controller {
  
          public function __construct() {
              parent::__construct();
              $this-&gt;load-&gt;model('registration_model');
          }
  
          public function index() {
              $this-&gt;load-&gt;library('form_validation');
  
              $this-&gt;form_validation-&gt;set_rules('email', 'E-mail', 'trim|required|valid_email|callback_email_available');
  
              if($this-&gt;form_validation-&gt;run() == FALSE) {
                  $this-&gt;load-&gt;view('registration');
              } else {
                  $this-&gt;registration_model-&gt;add_user();
              }
          }
  
          # Check E-mail
          public function email_available($email) {
              $this-&gt;db-&gt;select('email');
              $this-&gt;db-&gt;where('email', $email);
              $query = $this-&gt;db-&gt;get('users');
              $result = $query-&gt;row();
  
              if(!empty($result)) {
                  $this-&gt;form_validation-&gt;set_message('email_available', 'This e-mail belongs to another user.');
                  return FALSE;
              } else {
                  return TRUE;
              }
          }
  
      }
      ?&gt;
  </code></pre>
  
  <p>I have a registration form with Form Validation.
  And I have a callback function to validate email uniqueness.</p>
  
  <p>All code works fine, but I can directly access to callback function with errors</p>
  
  <p>examle.com/registration/email_available</p>
  
  <pre><code>A PHP Error was encountered
  Severity: Warning
  Message: Missing argument 1 for Registration::email_available()
  Filename: controllers/registration.php
  
  A PHP Error was encountered
  Severity: Notice
  Message: Undefined variable: email
  Filename: controllers/registration.php
  </code></pre>
  
  <p>How can I deny direct access to callback function?</p>