From 2098bf444afadcf0363d89b4cc1dca5d2213d754 Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Sat, 24 Apr 2021 19:40:50 -0600 Subject: Remove all uses of db_inc.php This method of importing the database login every time wasn't very good. Now everything uses the new Database singleton class. --- includes/reply_inc.php | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'includes/reply_inc.php') diff --git a/includes/reply_inc.php b/includes/reply_inc.php index cf7a839..588b59f 100644 --- a/includes/reply_inc.php +++ b/includes/reply_inc.php @@ -1,10 +1,8 @@ get_from_database($thread_id); -mysqli_stmt_bind_param($stmt, "sii", $reply_content, $reply_to, $post_author); -mysqli_stmt_execute($stmt); -mysqli_stmt_close($stmt); +create_post($reply_content, $thread_id, $thread->category); header("Location: ../thread.php?id=" . $_GET['reply_to']); \ No newline at end of file -- cgit v1.2.3 From fe3e6194d33d63f149f2a362adf325019278d61e Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Sat, 24 Apr 2021 19:50:59 -0600 Subject: Use Session class instead of $_SESSION --- includes/reply_inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'includes/reply_inc.php') diff --git a/includes/reply_inc.php b/includes/reply_inc.php index 588b59f..873d516 100644 --- a/includes/reply_inc.php +++ b/includes/reply_inc.php @@ -7,7 +7,7 @@ if ($_SERVER['REQUEST_METHOD'] != 'POST') { die('This file cannot be called directly.'); } -if (!isset($_SESSION['signed_in'])) { +if (!Session::get()->is_signed_in()) { die('You must be signed in to reply to a thread.'); } -- cgit v1.2.3 From df9177492976ba968a556a52cc155477652089dc Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Sun, 25 Apr 2021 17:47:41 -0600 Subject: Reload page after submitting a reply to a thread --- includes/reply_inc.php | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 includes/reply_inc.php (limited to 'includes/reply_inc.php') diff --git a/includes/reply_inc.php b/includes/reply_inc.php deleted file mode 100644 index 873d516..0000000 --- a/includes/reply_inc.php +++ /dev/null @@ -1,22 +0,0 @@ -is_signed_in()) { - die('You must be signed in to reply to a thread.'); -} - -$reply_content = filter_input(INPUT_POST, 'reply_content', FILTER_SANITIZE_STRING); -$thread_id = filter_input(INPUT_POST, 'reply_to', FILTER_SANITIZE_NUMBER_INT); - -$thread = new Thread(); -$thread->get_from_database($thread_id); - -create_post($reply_content, $thread_id, $thread->category); - -header("Location: ../thread.php?id=" . $_GET['reply_to']); \ No newline at end of file -- cgit v1.2.3