2 if (isset($_POST['login'])) {
3 if ($user = login($_POST['login'], $_POST['pass'])) {
4 setcookie('login', $user['auth'], 0, '/');
7 $target = ltrim(@$_GET['goto'], '/');
8 header("Location: /$target");
9 http_response_code(302);
13 echo '<p class="warn">Ongeldige gebruikersnaam of wachtwoord.</p>'."\n\n";
15 elseif (!empty($User)) {
16 setcookie('login', '', time(), '/'); # expire immediately
17 echo '<p class="warn">Uitgelogd.</p>'."\n\n";
21 <form action="" method="post">
22 <input id="login" name="login" placeholder="Huisnummer" />
23 <input id="pass" name="pass" type="password" value="" placeholder="Wachtwoord" />
24 <input type="submit" value="Log in" />