-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforum.php
More file actions
47 lines (43 loc) · 1.17 KB
/
forum.php
File metadata and controls
47 lines (43 loc) · 1.17 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
<?php
if (!isset($_SESSION)) {
session_start();
}
ini_set('display_errors', 1);
ini_set('display_startp_errors', 1);
error_reporting(-1);
include('Lib/Db.php');
include('Lib/Forum.php');
$Db = new Db();
$conn = $Db->getConntectie();
$forum = new forum();
if (isset($_SESSION['info'])) {
if (isset($_POST['submit'])) {
$forum->PostForum($_SESSION['info'][0]['Username'], $_POST['message'], $conn);
}
if (isset($_POST['submit_comment'])) {
echo ($_SESSION['info'][0]['Username']);
echo ($_POST['comment']);
echo ($_POST['submit_comment']);
$forum->PostComment($_SESSION['info'][0]['Username'], $_POST['comment'], $conn, $_POST['submit_comment']);
// print_r($_POST);
}
} else {
header('location:index.php');
}
include('layout/header.php');
include('layout/navigation-middle.php');
?>
<div>
<form action="forum.php" method="POST">
<input type="text" name="message" placeholder="subject">
<input type="submit" value="SUBMIT" name="submit">
</form>
</div>
<div class="Forum-Whole-Wrapper" id="main">
<?php
$forum->ShowForum($conn, 'Forum');
?>
</div>
<?php
include('layout/footer.php')
?>