-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
82 lines (82 loc) · 2.56 KB
/
index.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
include "connection.php";
session_start();
if (isset($_SESSION['username'])) {
$yes = $_SESSION['username'];
$result = mysqli_fetch_assoc(mysqli_query($link, "SELECT * FROM `Participants` WHERE `id`=$yes"));
echo "Current user: " . $result['naam'] . "<br>";
}
?>
<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="style.css">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
</head>
<body>
<?php
if (isset($_SESSION['username'])) {
echo "<br><form action='logout.php' method='POST' id='form_user'>";
echo "<input type='submit' class='button-34' value='logout', id='logout_user', name='logout_user'/>";
echo "</form>";
}
?>
<form action="login_register.php" method="POST" id="form">
<input type="submit" class="button-34" value="login/register" id="submit" name="submit">
</form>
<?php
if (!isset($_SESSION['username'])) {
echo "<br>";
}
?>
<form action="info.php" method="POST" id="form">
<input type="submit" class="button-34" value="Info/instructions" id="submit" name="submit">
</form>
<?php
if (!isset($_SESSION['username'])) {
echo "<br>";
}
?>
<form action="inserter_g.php" method="POST" id="form">
<input type="submit" class="button-34" value="insert gift (admin)" id="submit" name="submit">
</form>
<?php
if (!isset($_SESSION['username'])) {
echo "<br>";
}
?>
<form action="summary.php">
<input type="submit" class="button-34" value="view current standings"/>
</form>
<?php
if (!isset($_SESSION['username'])) {
echo "<br>";
}
?>
<form action="steal.php">
<input type="submit" class="button-34" value="steal a gift"/>
</form>
<?php
if (!isset($_SESSION['username'])) {
echo "<br>";
}
?>
<form action="give.php">
<input type="submit" class="button-34" value="give a gift"/>
</form>
<?php
if (!isset($_SESSION['username'])) {
echo "<br>";
}
?>
<form action="log.php">
<input type="submit" class="button-34" value="log"/>
</form>
</body>
</html>
<?php
if(isset($_POST['refresh'])) {
echo "USERNAME WAS NOT SET, PLEASE SET USERNAME ON TOP OF PAGE!";
}
?>