diff options
author | cflip <36554078+cflip@users.noreply.github.com> | 2021-05-08 17:30:08 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-08 17:30:08 -0600 |
commit | 87b1dfd1f77b08915ee5e905da45e316ba2c0e7d (patch) | |
tree | f6c0f8d09454b6e887df0f66ca37c1ce9efb30d0 /includes/reply_inc.php | |
parent | 0b045d57b2164b5ce003955d79627ae506a153eb (diff) | |
parent | a09d9f377f5c055e42e5f21b5cdea64c2e2ca896 (diff) |
Merge pull request #14 from cflip/refactor
Huge refactor
Diffstat (limited to 'includes/reply_inc.php')
-rw-r--r-- | includes/reply_inc.php | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/includes/reply_inc.php b/includes/reply_inc.php deleted file mode 100644 index cf7a839..0000000 --- a/includes/reply_inc.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -session_start(); - -include_once 'db_inc.php'; -include_once 'functions_inc.php'; - -if ($_SERVER['REQUEST_METHOD'] != 'POST') { - die('This file cannot be called directly.'); -} - -if (!isset($_SESSION['signed_in'])) { - die('You must be signed in to reply to a thread.'); -} - -$reply_content = filter_var($_POST['reply_content'], FILTER_SANITIZE_STRING); -$reply_to = $_GET['reply_to']; -$post_author = $_SESSION['user_id']; - -$sql = "INSERT INTO posts(post_content, post_date, post_thread, post_author) VALUES(?, NOW(), ?, ?)"; -$stmt = mysqli_stmt_init($dbc); - -if (!mysqli_stmt_prepare($stmt, $sql)) { - die('Failed to process statement: ' . mysqli_error($dbc)); -} - -mysqli_stmt_bind_param($stmt, "sii", $reply_content, $reply_to, $post_author); -mysqli_stmt_execute($stmt); -mysqli_stmt_close($stmt); - -header("Location: ../thread.php?id=" . $_GET['reply_to']);
\ No newline at end of file |