From fe41f57df59c7f2a11d80eaaebf08d3a3a51a6d5 Mon Sep 17 00:00:00 2001 From: h5p9sl <21267024+h5p9sl@users.noreply.github.com> Date: Thu, 13 May 2021 22:07:11 -0600 Subject: Add error handling --- viewthread.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'viewthread.php') diff --git a/viewthread.php b/viewthread.php index e8eda06..fa1c81b 100644 --- a/viewthread.php +++ b/viewthread.php @@ -68,29 +68,30 @@ foreach ($posts as $post) { ?>

Reply to this thread

-
- -
- -
- - is_signed_in()) { - echo 'You must be signed in to reply to this thread.'; + trigger_error('You must be signed in to reply to this thread.', E_USER_NOTICE); return; } $post_content = filter_input(INPUT_POST, 'post_content', FILTER_SANITIZE_STRING); if (empty($post_content) or !$post_content) { - echo 'Thread subject cannot be empty'; + trigger_error('Reply cannot be empty'); } else { create_post($post_content, $current->id, $current->category->id); header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $current->id); } } ?> +
+ +
+ +
+ + -- cgit v1.2.3