27 lines
784 B
PHP
27 lines
784 B
PHP
|
<?php include("../local/config.php");
|
||
|
|
||
|
if($conn) {
|
||
|
$busno = $_GET['b'];
|
||
|
$lat = $_GET['lat'];
|
||
|
$lon = $_GET['lon'];
|
||
|
$accuracy = $_GET['a'];
|
||
|
$stopno = $_GET['s'];
|
||
|
$stop = $_GET['sn'];
|
||
|
$direction = $_GET['d'];
|
||
|
$ip = $_SERVER['REMOTE_ADDR'];
|
||
|
$useragent = $_SERVER['HTTP_USER_AGENT'];
|
||
|
|
||
|
$sql = "INSERT INTO wherebus ";
|
||
|
$sql = $sql . " (busno, lat, lon, accuracy, stopno, stop, direction, ip, useragent, timeinserted ) VALUES ('";
|
||
|
$sql = $sql . $busno . "', " . $lat . ", " . $lon . ", " . $accuracy . ", "
|
||
|
. $stopno . ", '" . $stop . "', '" . $direction . "', '" . $ip . "', '" . $useragent . "', UTC_TIMESTAMP" .")";
|
||
|
$count = $conn->exec($sql);
|
||
|
echo $sql;
|
||
|
}
|
||
|
|
||
|
/*** close the database connection ***/
|
||
|
$conn = null;
|
||
|
|
||
|
|
||
|
?>
|