';
if (!isset($_SESSION['signed_in'])) {
- echo 'You must be signed in to create a topic.';
-} else {
- if ($_SERVER['REQUEST_METHOD'] != 'POST') {
- $sql = "SELECT cat_id, cat_name, cat_description FROM categories";
- $result = mysqli_query($dbc, $sql);
-
- if (!$result) {
- echo 'Error while selecting from database. Please try again later.';
- } else {
- if (mysqli_num_rows($result) == 0) {
- echo 'There are currently no categories to post to.';
- } else {
- echo '
-
+
+
\ No newline at end of file
diff --git a/includes/register_inc.php b/includes/register_inc.php
new file mode 100644
index 0000000..e69de29
diff --git a/includes/reply_inc.php b/includes/reply_inc.php
index 7f53fce..480c651 100644
--- a/includes/reply_inc.php
+++ b/includes/reply_inc.php
@@ -3,6 +3,7 @@
session_start();
include_once 'db_inc.php';
+include_once 'functions_inc.php';
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
die('This file cannot be called directly.');
@@ -19,15 +20,8 @@ if (!mysqli_stmt_prepare($stmt, $sql)) {
die('Failed to process statement: ' . mysqli_error($dbc));
}
-mysqli_stmt_bind_param($stmt, "sii", $_POST['post_content'], $_GET['reply_to'], $_SESSION['user_id']);
+mysqli_stmt_bind_param($stmt, "sii", $_POST['reply_content'], $_GET['reply_to'], $_SESSION['user_id']);
mysqli_stmt_execute($stmt);
+mysqli_stmt_close($stmt);
-$result = mysqli_stmt_get_result($stmt);
-
-if (!$result) {
- echo 'An error occurred trying to reply to the post. ' . mysqli_error($dbc);
-} else {
- echo 'Your reply has been saved, check out the topic.';
-}
-
-//header("Location: ../topic.php?id=" . $_GET['reply_to']);
\ No newline at end of file
+header("Location: ../topic.php?id=" . $_GET['reply_to']);
\ No newline at end of file
diff --git a/includes/topic_inc.php b/includes/topic_inc.php
new file mode 100644
index 0000000..c16a4e0
--- /dev/null
+++ b/includes/topic_inc.php
@@ -0,0 +1,47 @@
+
-
-
- cflip.net forum
-
-
-
-
-