Advertisement
Guest User

Untitled

a guest
Jul 4th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2. class Main extends Controller
  3. {
  4.  
  5. function __construct()
  6. {
  7. parent::Controller();
  8.  
  9. $this->load->helper('form');
  10. }
  11.  
  12. function index()
  13. {
  14. if ($this->session->userdata('log'))
  15. {
  16. echo 'logged in';
  17. }
  18. else
  19. {
  20. $this->_promptLogin();
  21. }
  22. }
  23.  
  24. function _promptLogin()
  25. {
  26. if($this->session->flashdata('loginError'))
  27. {
  28. echo 'login error<br />';
  29. }
  30. echo form_open('login/proc');
  31. echo 'Username: ' . form_input('username');
  32. echo '<br />Password: ' . form_password('password');
  33. echo form_submit('submit', 'Login');
  34. echo form_close();
  35. }
  36. }
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement