Skip to content

Instantly share code, notes, and snippets.

@arbaaz
Created January 20, 2014 18:51
Show Gist options
  • Save arbaaz/8526585 to your computer and use it in GitHub Desktop.
Save arbaaz/8526585 to your computer and use it in GitHub Desktop.
Form_validation_CI
$this->load->library('form_validation');
$this->form_validation->set_rules('first_name', 'User Name', 'trim|required|min_length[4]|max_length[15]|xss_clean');
$this->form_validation->set_rules('last_name', 'Last Name', 'trim|required|xss_clean');
$this->form_validation->set_rules('email_address', 'Email Address', 'trim|required|valid_email|xss_clean');
$this->form_validation->set_rules('username', 'User Name', 'trim|required|min_length[4]|xss_clean');
$this->form_validation->set_rules('password', 'Password', 'trim|required|min_length[6]|max_length[32]|xss_clean');
$this->form_validation->set_rules('password2', 'Password Confirmation', 'trim|required|matches[password]');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment