summaryrefslogtreecommitdiff
path: root/src/post-ajax.php
blob: df5a01a8182eb79f68b185ef1f065a06a81491da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<?php
if($_SERVER['REQUEST_METHOD'] === 'POST'){ // && $_SESSION['admin'] === true
	if($_SERVER['CONTENT_TYPE'] === 'application/json'){
		$data = file_get_contents('php://input');
		$json = json_decode($data, true);
		//var_dump($json);
		
		$id = isset($json['id']) ? $json['id'] : 7; // = id_event en BDD si nouvel évènement
		echo json_encode(['success' => true, 'id' => $id]);
		die;
	}
}