Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Login extends Controller {
- function __construct() {
- $login_model = $this->model('LoginModel');
- $data = array();
- if(isset($_POST['btn_login'])) {
- $data['given_identity'] = $_POST['given_identity'];
- $data['given_password'] = $_POST['given_password'];
- $checkCredentials = $login_model->checkCredentials($data['given_identity'], $data['given_password']);
- if($checkCredentials === true) {
- $tryLogin = $login_model->tryLogin($data['given_identity'], $data['given_password']);
- if($tryLogin === true) {
- $login_model->login($data['given_identity']);
- } else {
- echo $tryLogin;
- }
- } else {
- echo $checkCredentials;
- }
- }
- $this->view('login', $data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement