form validation rules in CodeIgniter

<?php

class Form extends CI_Controller {

    public function index()
    {
        $this->load->helper(array('form', 'url'));

        $this->load->library('form_validation');

        $this->form_validation->set_rules('username', 'Username', 
 'callback_username_check');
        $this->form_validation->set_rules('password', 'Password', 
 'required');
        $this->form_validation->set_rules('passconf', 
 'Password Confirmation', 'required');
        $this->form_validation->set_rules('email', 'Email', 
 'required|is_unique[users.email]');
 

Comments

Popular posts from this blog

Linux Shortcuts

Petra, Jordan

PayPal integration in PHP