forked from Ahe4d/spacemy.xyz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlanding.php
More file actions
67 lines (67 loc) · 2.83 KB
/
Copy pathlanding.php
File metadata and controls
67 lines (67 loc) · 2.83 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
require("func/conn.php");
require("func/settings.php");
?>
<!DOCTYPE html>
<html>
<head>
<title>spacemy.xyz</title>
<link rel="stylesheet" href="css/header.css">
<link rel="stylesheet" href="css/base.css">
</head>
<body>
<?php
require("header.php");
?>
<div class="container">
<div class="left">
<?php if(!isset($_SESSION['user'])){ ?>
<div class="info">
Log in
</div>
<br>
<form method="post" action="/login.php">
<input required placeholder="Username" type="text" name="username"><br>
<input required placeholder="Password" type="password" name="password"><br><br>
<input type="submit" value="Login"><span><small> New user? <a href="/register.php">Register</a></small></span>
</form>
<br>
<?php } ?>
<div class="info">
Latest Blog Posts
</div>
<br>
<?php
$result = $conn->query("SELECT id, title, author FROM blogs ORDER BY id DESC LIMIT 5");
while($row = $result->fetch_assoc())
{
echo "<a href='/blogs/view.php?id=".$row['id']."'>".$row['title']."</a> - by <a href='/profile.php?id=".getID($row['author'], $conn)."'>".$row['author']."</a><br><br>";
}
?>
<hr>
<a href="/blogs/">View more blog posts</a>
<br>
<br>
<div class="topBarWithItemsThing">
<a href="/blogs/">Blogs</a> <a href="/groups/">Groups</a> <a href="/register.php">Register</a> <a href="/login.php">Login</a>
</div>
<br>
THIS IS UNDER CONSTRUCTION!!<br/><br/>
<iframe src="https://canary.discordapp.com/widget?id=730672103644332032&theme=dark" style="width: calc(100%)" height="500" allowtransparency="true" frameborder="0" sandbox="allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts"></iframe>
</div>
<div class="right">
<div class="info">
Users
</div>
<br>
<?php
//preparing a statement isn't necessary, you're not querying with php input
$result = $conn->query("SELECT id, username FROM `users`");
while($row = $result->fetch_assoc()) {
echo "<a href='/profile.php?id=" . $row['id'] . "'>" . $row['username'] . "</a><br>";
}
?>
</div>
</div>
</body>
</html>