Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php
  2. class New extends Controller
  3. {
  4.     function index()
  5.     {
  6.         $this->load->view('new_view');
  7.     }
  8.  
  9.     function validate()
  10.     {
  11.         $this->form_validation->set_rules('author', 'Author', 'required|min_length[3]|max_length[50]');
  12.         $this->form_validation->set_rules('message', 'Message', 'required|min_length[3]');
  13.  
  14.         if($this->form_validation->run() == TRUE)
  15.         {
  16.             // If the form validation run true..
  17.         }
  18.         else
  19.         {
  20.             // If it dosen't..
  21.         }
  22.     }
  23. }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement