inventur/backend.php
2018-01-24 17:13:21 +01:00

23 lines
531 B
PHP

<?php
require "localconf.php";
if ($_SERVER['REQUEST_METHOD'] != "POST") {
echo "Sorry, ich spreche kein GET.";
return;
}
if (empty($_POST) && empty(file_get_contents('php://input'))) {
echo "Ich brauche INPUT";
return;
}
if ($_GET['controller'] == "Article"){
if ($_GET['action'] == "store") {
$json = file_get_contents('php://input');
$file = fopen(__DIR__.'/data/articles.json','w');
fwrite($file, $json);
fclose($file);
echo "Artikel wurden gespeichert.";
}
}