<?php

public function form_helper()

{

    $this->load->helper('url');
    $this->load->helper('form');
    $this->load->library('form_validation');


    $data['title'] = 'form title';
    $data['page_header'] = 'form helper in codeigniter';

    $this->form_validation->set_rules('email', 'E-mail', 'required|trim|valid_email');
    $this->form_validation->set_rules('password', 'password', 'required|trim');
    $this->form_validation->set_rules('url', 'URL', 'required');


    if ($this->form_validation->run() ** FALSE) {

        $this->load->view('view_form_helper', $data);
    } else {
        $data['email'] = $this->input->post('email');
        $data['password'] = $this->input->post('password');
        $data['pass_length'] = strlen($this->input->post('password'));
        $data['url'] = $this->input->post('url');
        $this->load->view('view_form_helper', $data);

    }

}
















?>