loginpagefoo/secure.php
2021-01-10 14:12:52 +01:00

36 lines
1006 B
PHP

<html>
<head>
<title>Secure Area</title>
<link rel="stylesheet" href="ressources/css/bootstrap.min.css" crossorigin="anonymous">
</head>
<body>
<script src="ressources/js/bootstrap.min.js"></script>
<?php
session_start();
if(!isset($_SESSION['userid'])) {
die('Please <a href="login.php">login</a>');
}
$username = $_SESSION['username'];
$activated = $_SESSION['activated'];
echo "Hi ".$username."!";
if(isset($_GET['activation_req'])) {
echo '<div class="alert alert-danger" role="alert">Your account isnt activated yet!</div><br>';
}
?>
<br><br>
<a href="profile.php"><button class="btn btn-primary">Profile</button></a>
<br><br>
<?php
if ($activated == 0) {
echo '<a href="?activation_req=1"><button class="btn btn-primary disabled">Activated Area</button></a>';
}
if ($activated == 1) {
echo '<a href="activatedarea.php"><button class="btn btn-primary">Activated Area</button></a>';
}
?>
<br><br>
<a href="logout.php"><button class="btn btn-danger">LOGOUT</button></a>
</body>
</html>