Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Dylan Lopez
Added: Mar 6, 2018 8:58 AM
Modified: Mar 6, 2018 8:59 AM
Views: 5
Tags: no tags
put in controller
  1. $this->load->helper(array('form', 'url'));
  2.  
  3. $this->load->library('form_validation');
  4.  
  5. $this->form_validation->set_rules('username', 'Username', 'required');
  6. $this->form_validation->set_rules('password', 'Password', 'required',
  7.     array('required' => 'You must provide a %s.')
  8. );
  9. $this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
  10. $this->form_validation->set_rules('email', 'Email', 'required');
  11.  
  12. if ($this->form_validation->run() == FALSE)
  13. {
  14.     $this->load->view('myform');
  15. }
  16. else
  17. {
  18.     $this->load->view('formsuccess');
  19. }