mChaloBEST/svr/sendbusinfo.php

27 lines
784 B
PHP
Raw Normal View History

2011-08-13 12:42:40 +00:00
<?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;
?>