1$this->form_validation->set_rules('email', 'Email', 'trim|required|valid_email');
2
1<?php
2
3class Form extends CI_Controller {
4
5 public function index()
6 {
7 $this->load->helper(array('form', 'url'));
8
9 $this->load->library('form_validation');
10
11 if ($this->form_validation->run() == FALSE)
12 {
13 $this->load->view('myform');
14 }
15 else
16 {
17 $this->load->view('formsuccess');
18 }
19 }
20}
21