iowebsite/staff/save_tasks.php

10 lines
304 B
PHP
Raw Normal View History

2024-01-29 00:02:02 -05:00
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$data = json_decode(file_get_contents("php://input"), true);
var_dump($data);
2024-01-29 00:02:02 -05:00
// 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);
2024-01-29 00:02:02 -05:00
}
?>