| author | veltr |
| Thu, 16 Aug 2012 15:12:18 +0200 | |
| changeset 12 | f21792c7b0ab |
| parent 5 | 67085e6281e5 |
| child 18 | 4423bfcd8f9f |
| permissions | -rw-r--r-- |
| 4 | 1 |
<?php |
2 |
header('Content-Type: application/json; charset=utf-8'); |
|
3 |
$file = "dynamic-data.json"; |
|
4 |
if (isset($_GET['reset']) && $_GET['reset']) { |
|
5 |
$resetfile = "test-data.json"; |
|
6 |
file_put_contents($file, file_get_contents($resetfile)); |
|
7 |
} |
|
| 5 | 8 |
if (isset($_POST['data'])) { |
9 |
file_put_contents($file, $_POST['data']); |
|
| 4 | 10 |
echo json_encode(array("result" => "OK")); |
11 |
} else { |
|
12 |
echo file_get_contents($file); |
|
13 |
} |
|
14 |
?> |