Пример #1
0
<?php

require_once "../includes/initialize.php";
$errors = array();
session_start();
if (isset($_POST['submit'])) {
    // Form has been submitted.
    $username = trim($_POST['username']);
    $password = trim($_POST['password']);
    // Check database to see if username/password exist.
    $found_admin = man_power::adminLogin($username, $password);
    //$found_sm = sm::authenticate($username, $password);
    if ($found_admin) {
        $_SESSION['adminname'] = $found_admin->username;
        redirect_to("adminDashboard.php");
    } else {
        $message = "Incorrect Username/Password.";
        flashMessage($message, 'error');
    }
}
if (isset($_SESSION['message'])) {
    echo $_SESSION['message'];
    unset($_SESSION['message']);
}
?>

<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">