2 include 'page.inc.php';
7 if (isset($_POST['login'])) {
8 if ($user = login($_POST['login'], $_POST['pass'])) {
9 setcookie('login', $user['auth'], 0, '/');
11 header("Location: /"); //TODO: goto
12 http_response_code(302);
16 echo '<p class="warn">Ongeldige gebruikersnaam of wachtwoord.</p>'."\n\n";
18 elseif (!empty($User)) {
19 setcookie('login', '', time(), '/'); # expire immediately
20 echo '<p class="warn">Uitgelogd.</p>'."\n\n";
24 <form action="" method="post">
25 <input id="login" name="login" placeholder="Huisnummer" />
26 <input id="pass" name="pass" type="password" value="" placeholder="Wachtwoord" />
27 <input type="submit" value="Log in" />