18 lines
450 B
PHP
18 lines
450 B
PHP
<?php
|
|
$headers = getallheaders();
|
|
|
|
if ($headers['Content-Type'] == 'application/json') {
|
|
$abandonsJSON = file_get_contents('php://input');
|
|
$_POST = ["ok"];
|
|
json_decode($abandonsJSON);
|
|
if (json_last_error() == JSON_ERROR_NONE) {
|
|
file_put_contents('abandons.json', $abandonsJSON);
|
|
echo "Enregistrement réussi";
|
|
} else {
|
|
echo "Erreur JSON";
|
|
exit;
|
|
}
|
|
}
|
|
|
|
echo file_get_contents('abandons.json');
|