Added http response code

This commit is contained in:
neerholt
2021-03-19 13:25:27 +01:00
parent 409556ca2e
commit 171e0a3765
18 changed files with 103 additions and 112 deletions
+6 -10
View File
@@ -25,23 +25,19 @@ if (isLogin()) {
//Try to save it
if(!$keyword->save()){
header("location: ../../../Frontend/index.html?error=FailedToSave");
exit();
http_response_code(500);
}else{
header("location: ../../../Frontend/index.html?success=KeyWordSaved");
exit();
http_response_code(201);
}
}else{
header("location: ../../../Frontend/index.html?error=YouCantSubmitAnyMoreKeyWords");
exit();
echo "limited upload reached";
http_response_code(400);
}
}else{
header("location: ../../../Frontend/index.html?error=CouldNotSubmitKeyWord");
exit();
http_response_code(400);
}
}else{
header("location: ../../../Frontend/index.html?error=NotLogin");
exit();
http_response_code(401);
}