<?php session_start(); include $_SERVER['DOCUMENT_ROOT'] . 'system/controller/ftgcontroller.php'; //Check if user is logged in $ftgcontroller = new ftgcontroller(); $ftgcontroller->checklogin(); if (isset($_GET['logout'])) { $ftgcontroller->logout(); } ?> <html> <head> <link rel="shortcut icon" href="/favicon.ico" type="image/png"> <title>FTG Admin Panel</title> <link rel="stylesheet" href="/public/css/bootstrap.css" /> <link rel="stylesheet" href="/public/css/bootstrap-theme.css" /> <link rel="stylesheet" href="/public/css/home.css" /> <link rel="stylesheet" href="/public/css/form.css" /> <script type="text/javascript" src="/public/js/jquery-2.1.4.min.js"></script> <script type="text/javascript" src="/public/js/bootstrap.min.js"></script> <script type="text/javascript" src="/public/js/ftgfunction.js"></script> </head> <body> <div class="sidebar"> <div class="links"> <ul id="links"> <li class="active"><a href="#"><p>Home</p></a></li> <li><a href="#"><p>Search</p></a></li> <li><a href="#"><p>Settings</p></a></li> <li><a href=<?php
<?php session_start(); // if Logged in already, redirect to home page if (isset($_SESSION['username'], $_SESSION['user_id'])) { header("Location:/home/"); } include $_SERVER['DOCUMENT_ROOT'] . "system/controller/ftgcontroller.php"; $con = mysqli_connect($hostname, $dbuser, $dbpass, $db); $ftgcontroller = new ftgcontroller(); //whitelist check /* if ($ftgcontroller->checkip() == false) { header("Location:/noaccess.php"); } */ if (isset($_POST['login'], $_POST['password'])) { //Sanitize strings $username = $con->real_escape_string($_POST['login']); $password = $con->real_escape_string($_POST['password']); if ($ftgcontroller->loginhandler(strtolower($username), $password, $con)) { header('Location: /home/index.php'); } } ?> <html> <head> <link rel="shortcut icon" href="/favicon.ico" type="image/png"> <title>FTG Admin Panel</title> <link rel="stylesheet" href="/public/css/bootstrap.css" /> <link rel="stylesheet" href="/public/css/bootstrap-theme.css" />