. */ error_reporting(E_ALL); //Debuging require_once 'include/DBConnection.inc.php'; function autoloader($classname) { include 'class/' . $classname . '.php'; } spl_autoload_register('autoloader'); $session = new Session(); $db = new Datenbank($dbname, $username, $password, $servername); /*===============================*/ if (isset($_SESSION["login"]) && $session->get("login") == 1) { if (isset($_SESSION["reload"]) && $session->get("reload") == 1) { $session->destroy(); $session->start(); $session->set("finished", 1); $url = "index.php"; header("Location: $url"); echo ''; echo ''; exit; } else { $session->set("reload", 1); } if (isset($_SESSION["status"]) && $session->get("status") == "ok") { $message = $session->get("message"); } } else { $session->set("status", "error"); $session->set("message", "Nicht eingeloggt"); $url = "index.php"; header("Location: $url"); echo ''; echo ''; exit; } ?>