Functions with validating

This commit is contained in:
Joey Lai
2017-01-19 15:55:28 +01:00
parent 049dee6381
commit 64ea5d3f68
6 changed files with 113 additions and 127 deletions

View File

@@ -15,16 +15,16 @@
// 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 {
$psw=$_POST["psw"];
$hash=getUser()["password"];
$userid=getUser()["userID"];
$uname = strtolower(test_input($_POST["uname"]));
$psw = test_input($_POST["psw"]);
$hash = getUser()["password"];
$userid = getUser()["userID"];
// If there's an account, go to the profile page
if(password_verify($psw, $hash)) {