This commit is contained in:
parent
849da8c135
commit
33094238ca
@ -1,24 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
# Obtain the JSON payload from an OwnTracks app POSTed via HTTP
|
# Obtain the JSON payload from an OwnTracks app POSTed via HTTP
|
||||||
# and insert into database table.
|
# and insert into database table.
|
||||||
|
|
||||||
header("Content-type: application/json");
|
header("Content-type: application/json");
|
||||||
|
|
||||||
$payload = file_get_contents("php://input");
|
$payload = file_get_contents("php://input");
|
||||||
$data = @json_decode($payload, true);
|
$data = @json_decode($payload, true);
|
||||||
|
|
||||||
if ($data['_type'] == 'location') {
|
if ($data['_type'] == 'location') {
|
||||||
file_put_contents('toto', serialize($data));
|
file_put_contents('toto', serialize($data));
|
||||||
$tst = $data['tst'];
|
$tst = $data['tst'];
|
||||||
$lat = $data['lat'];
|
$lat = $data['lat'];
|
||||||
$lon = $data['lon'];
|
$lon = $data['lon'];
|
||||||
$tid = $data['tid'];
|
$tid = $data['tid'];
|
||||||
# Convert timestamp to a format suitable for mysql
|
# Convert timestamp to a format suitable for mysql
|
||||||
$dt = date('Y-m-d H:i:s', $tst);
|
$dt = date('Y-m-d H:i:s', $tst);
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = array();
|
$response = array();
|
||||||
# optionally add objects to return to the app (e.g.
|
# optionally add objects to return to the app (e.g.
|
||||||
# friends or cards)
|
# friends or cards)
|
||||||
print json_encode($response);
|
print json_encode($response);
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user