Exemple #1
0
<?php

session_start();
if (isset($_SESSION['username']) || isset($_COOKIE['username'])) {
    header('Location: ../admin/home.php');
}
include "../php_library/class_frontend.php";
$user = new Frontend();
if (isset($_POST['submit'])) {
    if (isset($_POST['remember_me'])) {
        $_SESSION['cookie'] = 'enable';
    }
    if (!in_array(null, $_POST)) {
        $check = $user->login_checker($_POST);
        if ($check === 1) {
            $user = $_POST['username'];
            $_SESSION['username'] = $user;
            header('Location: ../admin/home.php');
        } else {
            $message = $check;
        }
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Log in Now</title>