melhora no funcionamento da home
This commit is contained in:
44
index.php
Normal file
44
index.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<!doctype html>
|
||||
<html lang="pt-br">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="css/base.css" />
|
||||
<link rel="stylesheet" href="css/style.css" />
|
||||
<script type="text/javascript" src="javascript/libs/vanila.js"></script>
|
||||
<title>;-;</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="menu">
|
||||
<label>Logo</label>
|
||||
<header>
|
||||
<ul>
|
||||
<li id="btn">
|
||||
<a href="index.php"> Inicio </a>
|
||||
</li>
|
||||
<li id="btn">
|
||||
<a href="index.php?pg=2"> Escrever Historia </a>
|
||||
</li>
|
||||
</ul>
|
||||
</header>
|
||||
</div>
|
||||
<?php
|
||||
$page = 1;
|
||||
$comps = ["inicio.php", "escrever.php"];
|
||||
if (isset($_GET["pg"]) and is_numeric($_GET["pg"])) {
|
||||
$page = $_GET["pg"];
|
||||
}
|
||||
|
||||
$file = "componentes/" . $comps[$page - 1];
|
||||
switch (file_exists($file)) {
|
||||
case true:
|
||||
require_once $file;
|
||||
break;
|
||||
default:
|
||||
http_response_code(404);
|
||||
die("<p>Error 404, arquivo não encontrado</p>");
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user