-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlegitimations2.php
More file actions
44 lines (41 loc) · 1.01 KB
/
legitimations2.php
File metadata and controls
44 lines (41 loc) · 1.01 KB
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
<?php
session_start();
//LOGIN/OUT
if(isset($_POST['logout'])){
session_destroy();
Unset($_SESSION['nickname']);
}
if(isset($_POST['login'])){
echo 'Sie Wollen sich anmelden';
//$_SESSION['nickname']='Thies';
echo '<form method=post>';
echo 'Nickname: <input type="text" name="nickname"><br>';
echo 'Passwort: <input type="password" name="password"><br>';
echo '<input type="submit" name="anmelden" value="anmelden">';
echo '</form>';
}
if(isset($_POST['anmelden'])){
$_SESSION['nickname']=$_POST['nickname'];
}
else{//Kennwort falsch
}
//exit;
//
if(isset($_SESSION['nickname'])){
echo '<div style="width:100% height:20px border:1px solidblack">';
echo 'Hallo '.$_SESSION['nickname'];
echo '<form method="post">
<input type="submit" name="logout" value="abmelden">
</form>
</div>';
}
else{
echo '<div style="width:100% height:20px border:1px solidblack">';
echo 'Hallo Gast';
echo '<form method="post">
<input type="submit" name="login" value="anmelden">
</form>
</div>';
exit;
}
?>