From 08d5f3c68fc5aadcf2262bf4d1b1ff53910362fd Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Fri, 30 Apr 2021 10:16:33 +0200 Subject: [PATCH] funktionierender login/logout --- login.php | 37 +++++++++++++++++++++++++++++++++++-- logout.php | 10 ++++++++++ overview.php | 2 +- 3 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 logout.php diff --git a/login.php b/login.php index 26f2330..e4c5859 100644 --- a/login.php +++ b/login.php @@ -2,16 +2,49 @@ require_once 'general.php'; returnHeader(); +session_start(); $config = getConfig(); -if (isset($_POST['login']) && !empty($_POST['username']) +if (isset($_POST['user']) && !empty($_POST['user']) && !empty($_POST['password'])) { if ($_POST['user'] == $config['user'] && $_POST['password'] == $config['password']) { - $_SESSION['timeout'] = time(); + $_SESSION['user'] = "Hello World"; + header('Location: ' . $config['url'] . '/overview.php'); + die();//https://thedailywtf.com/articles/WellIntentioned-Destruction + } + else { + echo "passwort nicht akzeptiert"; } } +?> + +
+
+
+
+ +
+ +
+ + +
+ +
+ + +
+ + + +
+
+
+ + \ No newline at end of file diff --git a/logout.php b/logout.php new file mode 100644 index 0000000..062e282 --- /dev/null +++ b/logout.php @@ -0,0 +1,10 @@ +fetchAll(PDO::FETCH_ASSOC);
- + ausloggen