<?php
class User extends MY_Controller {
public function __construct()
{
parent::__construct();
// No need to use get_instance() in a controller
// which extends a child of CI_Controller.
}
public function login()
{
if ($this->input->post('submit'))
{
$this->form_validation->set_rules('username', 'Username', 'is_required');
$this->form_validation->set_rules('password', 'Password', 'is_required');
if ($this->form_validation->run() === FALSE)
{
echo " Failed <br/>";
}
else
{
echo " Success <br/>";
}
}
}
}