Added http response code
This commit is contained in:
@@ -19,20 +19,18 @@ if(isset($_POST['aLogin'])){
|
||||
$_SESSION['userName'] = $userName;
|
||||
$_SESSION['admin'] = true;
|
||||
$_SESSION['success'] = "You are now logged in";
|
||||
header('location: ../../../Frontend/index.html?login=success');
|
||||
http_response_code(200);
|
||||
}else{
|
||||
session_destroy();
|
||||
header('location: ../../../Frontend/index.html?login=failed?reason=password');
|
||||
exit();
|
||||
echo "Fail to verify password";
|
||||
http_response_code(401);
|
||||
}
|
||||
|
||||
}else{
|
||||
session_destroy();
|
||||
header('location: ../../../Frontend/index.html?login=failed?reason=username');
|
||||
exit();
|
||||
echo "No user";
|
||||
http_response_code(401);
|
||||
}
|
||||
|
||||
}else{
|
||||
header("location: ../../../Frontend/index.html?error=NoLogin");
|
||||
exit();
|
||||
http_response_code(400);
|
||||
}
|
||||
Reference in New Issue
Block a user