Skip to content
Snippets Groups Projects
post.html 658 B
Newer Older
  • Learn to ignore specific revisions
  • Jonas Leder's avatar
    Jonas Leder committed
    <?php
    
    include "internal/header.php";
    include "internal/footer.php";
    
    
    Jonas Leder's avatar
    Jonas Leder committed
    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"];
    }
    
    
    Jonas Leder's avatar
    Jonas Leder committed
    ?>
        <p>
            <?php echo($content); ?>
        </p>