<?php
$pages = ["intro", "print-server", "print-get", "get-samples"];
$dir  = __DIR__ . "/content";
$file = null;
$page = "intro";

if (isset($_GET['page'])) {
    $page = $_GET['page'];
}

if (in_array($page, $pages, true)) {
    $file = $page . ".php";
} else {
    header("HTTP/1.0 404 Not Found");
}
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="style.css"/>
        <link rel='shortcut icon' href='img/favicon.ico'/>
        <title>Multipage</title>
    </head>
    <body>
        <aside>
            <?php include("aside.php");?>
        </aside>
        <main>
            <article>
                <?php include("content/$file")?>
                <footer class="byline"><?php include("footer.php")?></footer>
            </article>
        </main>
    </body>
</html>
