aboutsummaryrefslogtreecommitdiff
path: root/public/register.php
blob: f0f6596336eaa2c09ee1635543fdb38326e39083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?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: create new user in database

	// if all guards passed, successful login occurred
	cookie_redir($_POST['username'], $_POST['password'], "/");
} while (false);
?>
<html>
<head>
	<?php include 'head.php' ?>
	<title>registeren</title>
	<link rel='stylesheet' type='text/css' media='screen' href='login.css'>
</head>
<body>
	<?php include 'navbar.php' ?>
	<div class="main limwidth">
		<h1>Registreren</h1>
		<div class="modal">
			<form action="/register.php" method="post">
				<label for="username">Gebruikersnaam</label>
				<input id="username" name="username" type="text" placeholder="gebruikersnaam" class="buttonstyle">
				<label for="password">Wachtwoord</label>
				<input id="password" name="password" type="password" placeholder="wachtwoord" class="buttonstyle">
				<input type="submit" value="Registreren" class="button filled">
			</form>
			<span class="register">Of <a href="/login.php">inloggen</a></span>
		</div>
	</div>
	<?php include 'footer.php' ?>
</body>
</html>