Code Igniter Validation 2 - Proper Version


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. class Form extends Controller {
  4.  
  5. function index()
  6. {
  7. $this->load->helper(array('form', 'url'));
  8.  
  9. $this->load->library('validation');
  10.  
  11. if ($this->validation->run() == FALSE)
  12. {
  13. $this->load->view('myform');
  14. }
  15. else
  16. {
  17. $this->load->view('formsuccess');
  18. }
  19. }
  20. }
  21. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.