Example #1
0
<?php

session_start();
require_once "required/database.class.php";
require_once "required/Parsedown.php";
require_once "required/CONFIG.php";
$data = array();
$comments = array();
if (isset($_GET['s']) && is_numeric($_GET['s'])) {
    $db = new Database();
    $data = $db->story(intval($_GET['s']));
    if ($_POST['comment'] != "") {
        $db->comment_post($_POST, intval($_GET['s']));
        $link = "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
        header('Location: ' . $link);
    }
    $comments = $db->comment_retrieve(intval($_GET['s']));
} else {
    header('Location: index.php');
}
if (!$data || !isset($data)) {
    header('Location: index.php');
}
$Parsedown = new Parsedown();
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title><?php