<?php

session_start();
require_once "business/10-1.userservice.class.php";
if (isset($_GET["action"]) and $_GET["action"] === "login") {
    $login = UserService::controleerGebruiker($_POST["txtLogin"], $_POST["txtPaswoord"]);
    if ($login) {
        $_SESSION["login"] = TRUE;
        header("location: 10-1-geheim.php");
    } else {
        header("location: 10-1-loginform.php");
        exit(0);
    }
} else {
    include "presentation/10-1-loginform.php";
}
Beispiel #2
0
<?php

session_start();
require_once "business/userservice.class.php";
if (isset($_GET["action"])) {
    if ($_GET["action"] == "login") {
        $gebruikersnaam = $_POST["gebruikersnaam"];
        $wachtwoord = $_POST["wachtwoord"];
        $resultaat = UserService::controleerGebruiker($gebruikersnaam, $wachtwoord);
        if ($resultaat) {
            $_SESSION["aangemeld"] = true;
            header("Location: toongeheim.php");
            exit(0);
        } else {
            header("Location: aanmelden.php");
            exit(0);
        }
    }
} else {
    include "presentation/loginform.php";
}