add initial project files including JSON data, PHP scripts, and HTML structure
This commit is contained in:
17
abandons.php
Normal file
17
abandons.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?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');
|
||||
Reference in New Issue
Block a user