1
0
Fork 0
Authentication2.0/webroot/index.php

57 lines
1.4 KiB
PHP

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Authentication 2.0</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Bitter" rel="stylesheet">
</head>
<body>
<div class="box">
<?php if ($_SERVER['REQUEST_METHOD'] != 'POST') { ?>
<div class="code red">
<h1><?php echo $_SERVER['REQUEST_METHOD']; ?></h1>
</div>
<div class="sub grey">
<h2>Send your username for authentication.</h2>
</div>
<?php } else { ?>
<div class="code green">
<h1>POST</h1>
</div>
<?php if (!isset($_POST['username'])) { ?>
<div class="sub red">
<h2>What is your username?</h2>
</div>
<?php
} else {
$username = strtolower(htmlspecialchars($_POST['username']));
if ($username === 'admin' || $username === 'root' || $username === 'administrator') {
?>
<div class="sub">
<h2 class="blue">Hello admin</h2>
<h3 class="grey">SPACE{y0u_H4v3_t0_St4rt_S0m3Wh3r3}</h3>
</div>
<?php } else { ?>
<div class="sub">
<h2 class="blue">Hello <?php echo $username; ?></h2>
<h3 class="red">You don't have the permission to see anything.</h3>
</div>
<?php }}} ?>
</div>
</body>
</html>