diff options
Diffstat (limited to 'src/post-ajax.php')
-rw-r--r-- | src/post-ajax.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/post-ajax.php b/src/post-ajax.php index df5a01a..bedfed5 100644 --- a/src/post-ajax.php +++ b/src/post-ajax.php | |||
@@ -1,5 +1,7 @@ | |||
1 | <?php | 1 | <?php |
2 | if($_SERVER['REQUEST_METHOD'] === 'POST'){ // && $_SESSION['admin'] === true | 2 | session_start(); |
3 | |||
4 | if(isset($_SESSION['admin']) && $_SESSION['admin'] === true && $_SERVER['REQUEST_METHOD'] === 'POST'){ // && $_SESSION['admin'] === true | ||
3 | if($_SERVER['CONTENT_TYPE'] === 'application/json'){ | 5 | if($_SERVER['CONTENT_TYPE'] === 'application/json'){ |
4 | $data = file_get_contents('php://input'); | 6 | $data = file_get_contents('php://input'); |
5 | $json = json_decode($data, true); | 7 | $json = json_decode($data, true); |