-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
56 lines (49 loc) · 1.11 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
<!DOCTYPE html>
<html>
<head>
<title>WebHax</title>
</head>
<body>
<?php
session_start();
if (isset($_SESSION['username'])) {
echo $_SESSION['username'];
echo " <a href=\"php/profile.php?username=";
echo $_SESSION['username'];
echo "\">Profile</a>";
echo " <a href=\"php/edit.php\">Edit</a>";
echo " <a href=\"server/logout.php\">Logout</a> <br>";
}
else {
echo "<a href=\"php/login.php\">Login/Register</a> <br>";
}
?>
<h1>MyMaliciousSpace</h1>
<form action="php/profile.php" method="get">
Search Username: <input type="text" name="username"><br>
<input type="submit">
</form>
<br>
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
<?php
include "server/db.php";
$sql = "SELECT * FROM users";
$result = mysqli_query($link, $sql);
while ($row = mysqli_fetch_assoc($result)) {
echo "<tr> <td>";
echo $row['fname'];
echo "</td> <td>";
echo $row['lname'];
echo "</td> <td>";
echo $row['username'];
echo "</td> </tr>";
}
?>
</table>
</body>
</html>