Your comment is empty.
"; } else { if(!$author) { $author = "Anonymous"; } // insert comment into database $query = $con->prepare("INSERT INTO comments(comment_url, comment_author, comment_body, comment_onPost) VALUES(:commentUrl, :commentAuthor, :commentContent, :commentOnPost)"); $query->bindParam(":commentUrl", $commentUrlGen); $query->bindParam(":commentContent", $commentContent); $query->bindParam(":commentAuthor", $author); $query->bindParam(":commentOnPost", $postUrl); $query->execute(); // redirect to post page header("Location: ../status.php?url=$postUrl"); } } else { echo "This is not a post request
"; } ?>