diff options
Diffstat (limited to 'public/login.php')
-rw-r--r-- | public/login.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/public/login.php b/public/login.php new file mode 100644 index 0000000..22ac164 --- /dev/null +++ b/public/login.php @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<?php include "../lib/login.php" ?> +<?php // if_logged_in(true, "/") ?> +<?php +do { + if ($_SERVER['REQUEST_METHOD'] !== 'POST') break; + if (!$_POST['username']) break; + if (!$_POST['password']) break; + + //TODO: check if user exists in database + + // if all guards passed, successful login occurred + cookie_redir($_POST['username'], $_POST['password']); +} while (false); +?> +<html> +<head> + <?php include 'head.php' ?> + <title>login</title> + <link rel='stylesheet' type='text/css' media='screen' href='login.css'> +</head> +<body> + <?php include 'navbar.php' ?> + <div class="main limwidth"> + <h1>Inloggen</h1> + <div class="modal"> + <form action="/login.php" method="post"> + <label for="username">Gebruikersnaam</label> + <input id="username" name="username" type="text" placeholder="gebruikersnaam"> + <label for="password">Wachtwoord</label> + <input id="password" name="password" type="password" placeholder="wachtwoord"> + <input type="submit" value="Inloggen"> + </form> + <span class="register">Of <a href="/register.php">een nieuw account maken</a></span> + </div> + </div> + <?php include 'footer.php' ?> +</body> +</html> |