-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
42 lines (39 loc) · 1.05 KB
/
index.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
<?php
// session_start();
if(!isset($_SESSION)) {
session_start();
}
if($_COOKIE['usuario']) {
$_SESSION['usuario'] = $_COOKIE['usuario'];
}
if(!$_SESSION['usuario']) {
header('Location: login.php');
}
?>
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css2?family=Oswald:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="recursos/css/estilo.css">
<title>Curso PHP</title>
</head>
<body>
<header class="cabecalho">
<h1>Curso PHP</h1>
<h2>Índice dos Exercícios</h2>
</header>
<nav class="navegacao">
<span class="usuario">Usuário: <?= $_SESSION['usuario'] ?></span>
<a href="logout.php" class="vermelho">Sair</a>
</nav>
<main class="principal">
<div class="conteudo">
<?= require_once('menu.php') ?>
</div>
</main>
<footer class="rodape">
LUCASFFGOMES - <?= date('d/m/Y'); ?>
</footer>
</body>
</html>