WebServ/www/public/M6/04/index.php

24 lines
581 B
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>M6 | 04</title>
</head>
<body>
<?php
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
if(isset($_SESSION['logged_in']) && $_SESSION['logged_in'] == true) {
echo "<h1>Good</h1>";
echo $_SESSION['username'];
echo "<br>";
echo $_SESSION['name'];
}
else echo "<h1> No good </h1>";
?>
<br> <br>
<a href="login.php">Log In</a>
</body>
</html>