summaryrefslogtreecommitdiff
path: root/manage_post.php
diff options
context:
space:
mode:
Diffstat (limited to 'manage_post.php')
-rw-r--r--manage_post.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/manage_post.php b/manage_post.php
index 9e04dd4..99f0ad4 100644
--- a/manage_post.php
+++ b/manage_post.php
@@ -1,7 +1,6 @@
<?php
-include('includes/db_inc.php');
-include('includes/functions_post.php');
-include('includes/model/Post.php');
+include_once './includes/functions_post.php';
+include_once './includes/model/Post.php';
session_start();
@@ -13,7 +12,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'GET') {
include_once './includes/templates/404.php';
die();
} else {
- $result = $current->get_from_database($_GET['id'], $dbc);
+ $result = $current->get_from_database($_GET['id']);
if ($result == 0) {
http_response_code(404);
include_once './includes/templates/404.php';
@@ -26,7 +25,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'GET') {
$post_content = filter_input(INPUT_POST, 'post_content', FILTER_SANITIZE_STRING);
$post = new Post();
- $post->get_from_database($id, $dbc);
+ $post->get_from_database($id);
if (strcasecmp($delete, "on") == 0) {
delete_post($post);
@@ -47,7 +46,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'GET') {
<?php include('includes/templates/header.php'); ?>
<h1>Manage a post</h1>
<?php
-$current->display_content($dbc);
+echo get_post_content($current);
echo '<hr>';
$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);