Functions with validating
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user