Skip to content
Permalink
40def74ff2
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
50 lines (45 sloc) 1.11 KB
<!-- used to log in the user, also checks for any errors -->
<?php
session_start();
if (!isset($_SESSION['username'])) {
$_SESSION['msg'] = "You must log in first";
header('location: login.php');
}
if (isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['username']);
header("location: login.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<link rel="stylesheet" type="text/css" href="inc/css/stylee.css">
</head>
<body>
<div class="content">
<!-- notification message -->
<?php if (isset($_SESSION['success'])) : ?>
<div class="error success" >
<h3>
<?php
echo $_SESSION['success'];
unset($_SESSION['success']);
?>
</h3>
</div>
<?php endif ?>
<!-- if user log in is successful, displays the website menu -->
<?php if (isset($_SESSION['username'])) : ?>
<header>
<p>Welcome <strong><?php echo $_SESSION['username']; ?></strong></p>
<?php include('inc/menu.nav.php'); ?>
<div class="title">
<h1>Gamers Hub</h1>
</div>
</header>
<?php endif ?>
</div>
</body>
</html>