Update index.php

This commit is contained in:
jakani24
2024-01-14 14:31:20 +01:00
parent 79c588920d
commit 4ac7fc8f2c

View File

@@ -1,5 +1,16 @@
<?php
/*
session_start();
// Check if the user is logged in
if (!isset($_SESSION['username']) or !isset($_SESSION["login"])) {
// Redirect to the login page or handle unauthorized access
header("Location: /login.php");
exit();
}
$username = $_SESSION['username'];
*/
?>
<!DOCTYPE html>
@@ -14,7 +25,17 @@ session_start();
</head>
<body>
<div class="container mt-5">
<h1 class="text-center">Welcome to Bootstrap</h1>
<!-- Header -->
<div class="d-flex justify-content-between align-items-center mb-4">
<h1>Cyberhex</h1>
<div>
<span class="mr-3">Welcome, <?php echo $username; ?></span>
<a href="logout.php" class="btn btn-danger">Logout</a>
</div>
</div>
<!-- Main content -->
<h2 class="text-center">Welcome to Bootstrap</h2>
<p class="text-center">This is a simple webpage using Bootstrap CSS.</p>
<div class="alert alert-primary" role="alert">
This is a primary alert—check it out!