-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathforums.php
More file actions
75 lines (73 loc) · 2.44 KB
/
forums.php
File metadata and controls
75 lines (73 loc) · 2.44 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
68
69
70
71
72
73
74
75
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Forum</title>
<style>
th {
background-color: #4a4f55;
color: #ffffff;
font-weight:normal;
}
</style>
</head>
<body>
<?php
include("MainMenu.php");
?>
<?php
include("Connect_Database.php");
?>
<?php
$selectForums = "select * from forum;";
$results = mysqli_query($connect, $selectForums);
?>
<nav>
</nav>
<h2 align="center" style="margin-top:20px; margin-bottom:20px;">FORUM</h2>
<div class="fluid-container">
<div class="row">
<div class="col-8">
<table class="table table-bordered table-sm" style="margin-left: 50px;">
<thead class="thead-light">
<tr>
<th>NAME</th>
<th>POST</th>
</tr>
<?php
while($row = mysqli_fetch_assoc($results)){
print "<tr>";
print "<td>";
print ($row["poster_name"]);
print "</td>";
print "<td>";
print ($row["post"]);
print "</td>";
print "</tr>";
}
?>
</thead>
</table>
</div>
<div class="col-4">
<form action="forumsinsert.php" method="post">
<table align="center" style="margin-left: 50px;">
<tr>
<td>Posting as: <?php print $_SESSION['name']?></td>
<td style="text-align: left;"><input type="hidden" name="name" value="<?php print $_SESSION['name']?>"/></td>
<input type="hidden" name="id" value="<?php print $_SESSION['id']?>" />
</tr>
<tr>
<td colspan="2"><textarea rows="6" cols="40" name="post" maxlength="250" required></textarea></td>
</tr>
<tr>
<td></td>
<td style="text-align: right;"><input class="btn btn-primary" style="width: 100px; height: 40px;" type="submit" value="Post"></td>
</tr>
</table>
</form>
</div>
</div>
</div>
</body>
</html>