Example #1
0
<?php

$title = "Inicio";
session_start();
if (!empty($_SESSION['id'])) {
    echo "<script>window.location='dashboard.php';</script>";
}
include_once "../clases/Database.php";
include_once "../clases/Query.php";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    $username = $_POST['username'];
    $password = $_POST['password'];
    $db = new Database();
    if ($db->isLogin($username, $password)) {
        $_SESSION['id'] = $db->getUserId($username, $password);
        header("Location:dashboard.php");
    } else {
        $errors = true;
    }
}
?>



<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.5
Version: 4.5.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com