-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib_auth.php
48 lines (46 loc) · 1.69 KB
/
lib_auth.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
function createUser($mysqli, $name, $admin, $password){
$mysqli->query("INSERT INTO user(name, admin, pw_blowfish) VALUES ('$name','$admin','$password');");
}
function showLogout(){
echo '
<p>Eingelogt als: ' . $_SESSION["user"] . '</p>
<br>
<form action="' . $_SERVER["PHP_SELF"] . '" method="post">
<button name="abmelden">abmelden</button>
</form>
<br>
<h1>Eintrag erfassen</h1>
<br>
<form action="' . $_SERVER["PHP_SELF"] . '" method="post">
<textarea name="eintragText" placeholder="Hier Eintrag eingeben"></textarea>
<button name="eintragErfassen">Erfassen</button>
</form>
<br>
<h1>Einträge Lesen</h1>
<br>';
}
function showLogin(){
echo '
<form id="loginForm" method="POST" action="">
<div class="form-group">
<label class="whiteFont" for="username">Benutzername</label>
<!-- Check E-Mail -->
<input class="form-control" type="email" placeholder="[email protected]" id="username" name="username" required>
</div>
<div class="form-group">
<label class="whiteFont" for="password">Passwort</label>
<input class="form-control" type="password" id="password" name="password" required>
</div>
<div class="form-group input--register">
<label class="whiteFont" for="password_confirmation">Passwort wiederholen</label>
<input class="form-control" type="password" id="password_confirmation" name="password_confirmation">
</div>
<div class="form-group">
<button class="btn btn-primary" id="btnSubmit" name="btnSubmit" type="submit">Registrieren</button>
<button class="btnReset btn btn-danger" id="btnReset" type="reset">Reset</button>
</div>
</form>
';
}
?>