aboutsummaryrefslogtreecommitdiff
path: root/public/login.php
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-05-08 17:08:54 +0200
committerlonkaars <loek@pipeframe.xyz>2023-05-08 17:08:54 +0200
commitcda96d31939c7ea727c114b162f43bb4d18314a2 (patch)
treeaa1aac2c746c5a1452b11af3f187d499b5a9ce5f /public/login.php
parent08d6281d872a8d2a496462f131cbdc860432acc0 (diff)
more website
Diffstat (limited to 'public/login.php')
-rw-r--r--public/login.php39
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>