summaryrefslogtreecommitdiff
path: root/src/post-ajax.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/post-ajax.php')
-rw-r--r--src/post-ajax.php14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/post-ajax.php b/src/post-ajax.php
deleted file mode 100644
index bedfed5..0000000
--- a/src/post-ajax.php
+++ /dev/null
@@ -1,14 +0,0 @@
1<?php
2session_start();
3
4if(isset($_SESSION['admin']) && $_SESSION['admin'] === true && $_SERVER['REQUEST_METHOD'] === 'POST'){ // && $_SESSION['admin'] === true
5 if($_SERVER['CONTENT_TYPE'] === 'application/json'){
6 $data = file_get_contents('php://input');
7 $json = json_decode($data, true);
8 //var_dump($json);
9
10 $id = isset($json['id']) ? $json['id'] : 7; // = id_event en BDD si nouvel évènement
11 echo json_encode(['success' => true, 'id' => $id]);
12 die;
13 }
14} \ No newline at end of file