<?php
class Test extends CI_Controller {
public function __construct() {
parent::__construct();
// Loading helpers and library
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
}
function login_pro() {
$this->form_validation->set_rules('Username', 'Username', 'required');
$this->form_validation->set_rules('Password', 'Password', 'required');
if ($this->form_validation->run() == FALSE) {
echo 'try again';
} else {
echo 'welcome';
}
}
}