Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- class Login extends Controller {
- function Login()
- {
- parent::Controller();
- }
- function index()
- {
- $this->form_validation->set_rules('email', 'email', 'required');
- $this->form_validation->set_rules('password', 'password', 'required');
- // Load user model
- $this->load->model('users');
- if ($this->form_validation->run() == FALSE){
- $this->load->view('login');
- } else {
- if ($this->users->login($_POST['email'],$_POST['password']) == FALSE){
- $this->form_validation->set_message('login', 'Sorry, but that email and/or password cannot be found.');
- $this->load->view('login');
- } else {
- // Success, forward
- redirect('dashboard');
- }
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment