iowebsite/staff/save_tasks.php

10 lines
304 B
PHP

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$data = json_decode(file_get_contents("php://input"), true);
var_dump($data);
// Store tasks in a flat-file database (tasks.txt)
$ret = file_put_contents("tasks.json", json_encode($data["tasks"], JSON_PRETTY_PRINT));
var_dump($ret);
}
?>