SHARE
TWEET

Untitled

a guest Apr 20th, 2019 110 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top