diff --git a/application/config/autoload.php b/application/config/autoload.php index 86bb92d..b846a7e 100644 --- a/application/config/autoload.php +++ b/application/config/autoload.php @@ -58,7 +58,7 @@ $autoload['packages'] = array(); | | $autoload['libraries'] = array('user_agent' => 'ua'); */ -$autoload['libraries'] = array(); +$autoload['libraries'] = array('form_validation'); /* | ------------------------------------------------------------------- diff --git a/application/controllers/login.php b/application/controllers/login.php index a2e9cd2..15717f3 100644 --- a/application/controllers/login.php +++ b/application/controllers/login.php @@ -15,8 +15,17 @@ class Login extends CI_Controller // Header $this->load->view('header'); - // Content - $this->load->view('login'); + $this->form_validation->set_rules('username', 'Username', 'required'); + $this->form_validation->set_rules('password', 'Password', 'required'); + + if ($this->form_validation->run() == FALSE) + { + // login page + $this->load->view('login'); + } else { + echo "Done"; + } + // Footer $this->load->view('footer'); diff --git a/application/views/login.php b/application/views/login.php index 721d215..837bfc2 100644 --- a/application/views/login.php +++ b/application/views/login.php @@ -8,6 +8,7 @@
+