2020-10-13 17:11:32 +02:00
|
|
|
<?php
|
|
|
|
include "internal/mysql.php";
|
2020-12-20 00:33:23 +01:00
|
|
|
include "internal/header.php";
|
|
|
|
include "internal/footer.php";
|
|
|
|
|
2020-10-13 17:11:32 +02:00
|
|
|
if(isset($_GET["template"])){
|
|
|
|
$title = "[TITLE]";
|
|
|
|
$content = "[CONTENT]";
|
|
|
|
$date = "DATE NOT SHOWN IN PREVIEW";
|
|
|
|
$id = "0";
|
|
|
|
|
|
|
|
} else{
|
|
|
|
$id = $conn->real_escape_string($_GET["id"]);
|
|
|
|
$result = $conn->query("SELECT * FROM posts WHERE id=$id");
|
|
|
|
if ($result->num_rows > 0) {
|
|
|
|
$row = $result->fetch_assoc();
|
|
|
|
} else {
|
|
|
|
die("Post not found");
|
|
|
|
}
|
|
|
|
|
|
|
|
$title = $row["title"];
|
|
|
|
$content = $row["content"];
|
|
|
|
$date = $row["date"];
|
|
|
|
$id = $row["id"];
|
|
|
|
}
|
|
|
|
|
2020-12-20 00:33:23 +01:00
|
|
|
getHeader($title, "");
|
2020-10-13 17:11:32 +02:00
|
|
|
?>
|
|
|
|
<p>
|
|
|
|
<?php echo($content); ?>
|
|
|
|
</p>
|
2020-12-20 00:33:23 +01:00
|
|
|
<?php
|
|
|
|
getFooter();
|