hanze/iwa-panda2

logic/login.php in datatowebsite
Repositories | Summary | Log | Files | README.md

login.php (544B) download


 1<?php
 2include "utils\autoloader.php";
 3
 4//create login class
 5$login_handler = new Login_handler;
 6$msg = "";
 7if ($_SERVER["REQUEST_METHOD"] == "POST") {
 8    if(isset($_POST['email']) || !isset($_POST['password'])){
 9        // fetch data from the form pass to login_handler function
10        if(($login_handler->login($_POST['email'], $_POST['password']))){
11            //authenticated
12            header('Location: /dashboard');
13        }else{
14            $msg = "<p style=\"color:red\">Incorrect username of password.</p>";
15        }
16    }
17}  
18?>