Guest User

Untitled

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