Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. <?php
  2.  
  3. class Login extends Controller {
  4. function __construct() {
  5. $login_model = $this->model('LoginModel');
  6.  
  7. $data = array();
  8.  
  9. if(isset($_POST['btn_login'])) {
  10. $data['given_identity'] = $_POST['given_identity'];
  11. $data['given_password'] = $_POST['given_password'];
  12. $checkCredentials = $login_model->checkCredentials($data['given_identity'], $data['given_password']);
  13. if($checkCredentials === true) {
  14. $tryLogin = $login_model->tryLogin($data['given_identity'], $data['given_password']);
  15. if($tryLogin === true) {
  16. $login_model->login($data['given_identity']);
  17. } else {
  18. echo $tryLogin;
  19. }
  20. } else {
  21. echo $checkCredentials;
  22. }
  23. }
  24.  
  25. $this->view('login', $data);
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement