Files
biblioteca-de-contos/index.php

48 lines
1.6 KiB
PHP

<!doctype html>
<html lang="pt-br">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="assets/favicon.png">
<link rel="stylesheet" href="css/base.css" />
<link rel="stylesheet" href="css/home.css" />
<script type="text/javascript" src="javascript/libs/jquery.js"></script>
<script type="text/javascript" src="javascript/libs/vanila.js"></script>
<title>;-;</title>
</head>
<body>
<div id="menu">
<label></label>
<header>
<ul>
<a href="index.php"><li id="btn">
Inicio
</li></a>
<a href="index.php?pg=2"><li id="btn">
Escrever Historia
</li></a>
</ul>
</header>
</div>
<?php
set_error_handler(function ($severity, $message, $file, $line) {
throw new ErrorException($message, 0, $severity, $file, $line);
});
$page = filter_input(INPUT_GET, "pg", FILTER_VALIDATE_INT) ?: 1;
$comps = ["inicio.php", "escrever.php"];
try {
$file = "componentes/" . $comps[$page - 1];
if (!file_exists($file)) {
http_response_code(404);
die("<p>Error 404, arquivo não encontrado</p>");
}
} catch (Exception $e) {
$file = "componentes/inicio.php";
}
require_once $file;
?>
</body>
</html>