<!--
Partie PHP, elle vérifie si la session existe, si ce n'est pas le cas
on sera automatiquement redirigé vers la page d'authentification
-->
<?php
session_start(); // On prolonge ou restaure la session
if(empty($_SESSION['login'])) { // Si la session login est vide
header('Location: page_auth.php'); // On redirige vers la page : page_auth.php
exit(); // On quitte
}
?>
<!--
Partie HTML, elle est affichée si et seulement si la session existe
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Page admin</title>
</head>
<body>
<h1>Page admin, personne ne doit venir ici sans les accès</h1>
<p>
<button onclick="window.location.href = 'page_accueil.php';">Page Accueil</button>
<button onclick="window.location.href = 'page_deco.php';">Déconnexion</button>
</p>
</body>
</html>