-
Notifications
You must be signed in to change notification settings - Fork 0
/
view.php
56 lines (49 loc) · 1.39 KB
/
view.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>
<head>
<title>IP Tracer</title>
<link rel="stylesheet" href="table.css">
</head>
<body>
<?php
require("servers.php");
require("config.php");
$serverID = $serverList[$_GET["server"]]["id"];
$serverName = $serverList[$_GET["server"]]["name"];
?>
<h1 style="margin-left:auto;margin-right:auto;"><?php echo "IP Tracer Results for ".$serverName; ?></h1>
<?php
$conn = new mysqli($sql_servername, $sql_username, $sql_password, $sql_dbname);
if ($conn->connect_error) {
die($conn->connect_error);
}
$sql = "select time, steamUsername, steamID, userIP, userLocation from iptracer where serverID = \"".$serverID."\" order by time DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo "<table border=1 style=\"width: 85%;margin-left: auto;margin-right: auto;\">";
echo "<tr>";
echo "<th>Timestamp</th>";
echo "<th>Username</th>";
echo "<th>SteamID</th>";
echo "<th>IP Address</th>";
echo "<th>Reported Location</th>";
echo "</tr>";
while($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>".$row["time"]."</td>";
echo "<td>".$row["steamUsername"]."</td>";
echo "<td>".$row["steamID"]."</td>";
echo "<td>".$row["userIP"]."</td>";
echo "<td>".$row["userLocation"]."</td>";
echo "</tr>";
}
echo "</table>";
} else {
echo "<p>0 results.</p>";
}
$conn->close();
?>
<footer>
<p>Please note, all times are in London time (GMT/BST).<p>
</footer>
</body>
</html>