Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Registration extends CI_Controller {
- public function index() {
- $this->load->helper('url');
- $this->load->library('form_validation');
- $this->form_validation->set_rules('first_name', 'First Name', 'trim|required|alpha|min_length[2]|max_length[10]');
- $this->form_validation->set_rules('middle_name', 'Middle Name', 'trim|required|alpha|min_length[2]|max_length[10]');
- $this->form_validation->set_rules('last_name', 'Last Name', 'trim|required|alpha|min_length[2]|max_length[10]');
- $this->form_validation->set_rules('gender', 'Gender', 'required');
- $this->form_validation->set_rules('email', 'Email', 'required|valid_email');
- $this->form_validation->set_rules('place_of_birth', 'Place Of Birth', 'trim|required|alpha');
- $this->form_validation->set_rules('date_of_birth', 'Date Of Birth', 'trim|required');
- $this->form_validation->set_rules('address', 'Address', 'trim|required');
- $this->form_validation->set_rules('province', 'Province', 'trim|required');
- $this->form_validation->set_rules('districts', 'Districts', 'trim|required');
- $this->form_validation->set_rules('postal_code', 'Postal Code', 'trim|required|numeric');
- $this->form_validation->set_rules('phone', 'Phone No.', 'trim|required|numeric');
- $this->form_validation->set_rules('father_name', 'Father Name', 'trim|required|alpha|min_length[3]|max_length[30]');
- $this->form_validation->set_rules('father_occupation', 'Father Occupation', 'trim|required');
- $this->form_validation->set_rules('father_phone', 'Father Phone No.', 'trim|required|numeric');
- $this->form_validation->set_rules('mother_name', 'Mother Name', 'trim|required|alpha|min_length[3]|max_length[30]');
- $this->form_validation->set_rules('mother_occupation', 'Mother Occupation', 'trim|required');
- $this->form_validation->set_rules('mother_phone', 'Mother Phone No.', 'trim|required|numeric');
- $this->form_validation->set_rules('parent_address', 'Parent Address', 'trim|required');
- if ($this->form_validation->run() == FALSE)
- {
- $this->load->view('view_registration');
- }
- else
- {
- $this->load->view('formsuccess');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement