Guest User

Untitled

a guest
Oct 18th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. function process_login()
  2. {
  3. $this->form_validation->set_rules('username', 'Username', 'required');
  4. $this->form_validation->set_rules('password', 'Password', 'required');
  5.  
  6. if ($this->form_validation->run() == TRUE)
  7. {
  8. $username = $this->input->post('username');
  9. $password = $this->input->post('password');
  10.  
  11. if ($this->Login_model->check_user($username, $password) == TRUE)
  12. {
  13. $data = array('username' => $username, 'login' => TRUE);
  14. $this->session->set_userdata($data);
  15. redirect('absen');
  16. }
  17. else
  18. {
  19. $this->session->set_flashdata('message', 'Maaf, username dan atau password Anda salah');
  20. redirect('login/index');
  21. }
  22. }
  23. else
  24. {
  25. $this->load->view('login/login_view');
  26. }
  27. }
Add Comment
Please, Sign In to add comment