Update index.php
This commit is contained in:
@@ -1,5 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
/*
|
||||||
session_start();
|
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>
|
<!DOCTYPE html>
|
||||||
@@ -14,7 +25,17 @@ session_start();
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container mt-5">
|
<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>
|
<p class="text-center">This is a simple webpage using Bootstrap CSS.</p>
|
||||||
<div class="alert alert-primary" role="alert">
|
<div class="alert alert-primary" role="alert">
|
||||||
This is a primary alert—check it out!
|
This is a primary alert—check it out!
|
||||||
|
|||||||
Reference in New Issue
Block a user