-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlisteners.php
26 lines (24 loc) · 945 Bytes
/
listeners.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
if(isset($_POST["btnSubmit"])){
if(isset($_POST["password_confirmation"])) {
$_SESSION["user"] = $_POST["username"];
$_SESSION["password"] = $_POST["password"];
$passwordwiderholen = $_POST["password_confirmation"];
createUser($mysqli, $_SESSION["user"], false, $_SESSION["password"]);
echo '<script>location.reload();</script>';
}else {
$_SESSION["user"] = $_POST["username"];
$_SESSION["password"] = $_POST["password"];
$auth = is_auth($mysqli, $_SESSION["user"], $_SESSION["password"]);
echo '<script>location.reload();</script>';
}
}
if(isset($_POST["abmelden"])){
$_SESSION["user"] = null;
echo'<script>location.reload();</script>';
}
if(isset($_POST["eintragErfassen"])){
$date = new DateTime();
insertEintrag($mysqli, $_SESSION["user"], $_POST["eintragText"], date('Y-m-d h:i:s'));
echo'<script>location.reload();</script>';
}