login.php (521B) 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 }
14 }
15 $msg = "<p style=\"color:red\">Incorrect username of password.</p>";
16}
17?>