Fixed login link

This commit is contained in:
Joey Lai
2017-01-18 15:53:10 +01:00
parent 0808d46d9e
commit 455705e286
5 changed files with 27 additions and 17 deletions

View File

@@ -15,21 +15,21 @@
// Trying to login
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$uname=strtolower($_POST["uname"]);
// Empty username or password field
if (empty($_POST["uname"]) || empty($_POST["psw"])) {
$loginErr = "Gebruikersnaam of wachtwoord is niet ingevuld";
}
else {
$uname=strtolower($_POST["uname"]);
$psw=$_POST["psw"];
$hash=hashPassword()["password"];
$userid=hashPassword()["userID"];
// If there's an account, go to the profile page
if(password_verify($psw.$uname, $hash)) {
$_SESSION["userID"] = $userid;
header("location: /profile.php");
header("location: profile.php");
} else {
$loginErr = "Inloggegevens zijn niet correct";