-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercicio.php
57 lines (43 loc) · 1.43 KB
/
exercicio.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
session_start();
if ($_COOKIE['usuario']) {
$_SESSION['usuario'] = $_COOKIE['usuario'];
}
if (!$_SESSION['usuario']) {
header('Location: login.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.google.com/share?selection.family=Open%20Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800">
<link rel="stylesheet" href="recursos/css/estilo.css">
<link rel="stylesheet" href="recursos/css/exercicio.css">
<title>Exercício</title>
</head>
<body class="exercicio">
<header class="cabecalho">
<h1>Curso PHP</h1>
<h2>Visualização do Exercício</h2>
</header>
<nav class="navegacao">
<span class="usuario">Usuário: <?= $_SESSION['usuario'] ?></span>
<a href=<?= "{$_GET['dir']}/{$_GET['file']}.php" ?> class="verde">Sem formatação</a>
<a href="index.php">Voltar</a>
<a class="vermelho" href="logout.php">Sair</a>
</nav>
<main class="principal">
<div class="conteudo">
<?php
include(__DIR__ . "/{$_GET['dir']}/{$_GET['file']}.php");
?>
</div>
</main>
<footer class="rodape">
LUCAS MAGALHÃES © <?= date('Y') ?>
</footer>
</body>
</html>