Welcome Guest, Not a member yet? Register   Sign In
How do I prevent general users from accessing the callback function for the form_validation class?
#2

[eluser]victorcl[/eluser]
use an underscore in the first character of your name function.
Code:
controller Some_controller extends CI_Controller {
  function some_page() {
    if($this->input->post()) {
      $this->form_validation->set_rules('some_field', 'Some Field', '_callback_some_field_verifier');
      $this->form_validation->run();
    }
  }

  function _some_field_verifier($str) {
    if($str !== 'some sort of verification') {
      return false;
    } else {
      return true;
    }
  }
}


Messages In This Thread
How do I prevent general users from accessing the callback function for the form_validation class? - by El Forum - 05-30-2012, 09:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB