article generator throws 405 on non-post
This commit is contained in:
parent
e8b715de8d
commit
d58562538f
1 changed files with 9 additions and 0 deletions
|
@ -149,6 +149,15 @@ function load_blog($conn, $blogId){
|
||||||
$datePosted, $dateEdited, $tags, $comments);
|
$datePosted, $dateEdited, $tags, $comments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If request is not POST, throw method not allowed
|
||||||
|
if(strcmp($_SERVER["REQUEST_METHOD"], "POST") != 0)
|
||||||
|
{
|
||||||
|
header($_SERVER["SERVER_PROTOCOL"]." 405 Method Not Allowed", true, 405);
|
||||||
|
include_once($_SERVER["DOCUMENT_ROOT"]."/errors/405.php");
|
||||||
|
include_once($COMMONS."/footer.php");
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
// Check DB connection
|
// Check DB connection
|
||||||
if($conn == null){
|
if($conn == null){
|
||||||
header($_SERVER["SERVER_PROTOCOL"]." 503 Service Unavailable", true, 503);
|
header($_SERVER["SERVER_PROTOCOL"]." 503 Service Unavailable", true, 503);
|
||||||
|
|
Loading…
Reference in a new issue