Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/03/2016, 06:32
gamunaxx
 
Fecha de Ingreso: marzo-2016
Ubicación: lima
Mensajes: 1
Antigüedad: 8 años, 1 mes
Puntos: 0
Respuesta: Calcular tiempo estimado de llegada

Hola, yo recien estoy implementando esta parte de Self-Hosted-GPS-Tracker la aplicacion en el android, pero tengo problemas, estoy colocando el servidor en mi caso: http://marmatcourier.com/gpstracker/gps.php , pero no me envia ningun dato a mi servidor web, en el archuivo gps.php hay _GET para extraer los datos, pero no me funciona, no se si he hecho mal en configurar la ruta de mi servidor web en el aplicativo?, te comento esto porque veo que pones que a ti si te salio, favor ayudame, gracias

este es mi codigo de gps.php:

<?php
// THIS IS ONLY A SAMPLE SCRIPT. PLEASE TWEAK IT TO YOUR NEEDS.
// IT COMES WITH NO WARRANTY WHATSOEVER.
$file = "/tmp/gps-position.txt"; // you might save in a database instead...
if (isset($_GET["lat"]) && preg_match("/^-?\d+\.\d+$/", $_GET["lat"])
&& isset($_GET["lon"]) && preg_match("/^-?\d+\.\d+$/", $_GET["lon"]) ) {
$fh = fopen($file, "w");
if (!$fh) {
header("HTTP/1.0 500 Internal Server Error");
exit(print_r(error_get_last(), true));
}
fwrite($fh, date("Y-m-d H:i:s")."_".$_GET["lat"]."_".$_GET["lon"]."_");
if (isset($_GET["t"]) && preg_match("/^\d+$/", $_GET["t"])) {
fwrite($fh, $_GET["t"]);
}
fclose($fh);
// you should obviously do your own checks before this...
echo "OK";
} elseif (isset($_GET["tracker"])) {
// do whatever you want here...
echo "OK";
} else {
header('HTTP/1.0 400 Bad Request');
echo 'Please type this URL in the <a href="https://play.google.com/store/apps/details?id=fr.herverenault.selfhostedgpstracker">S elf-Hosted GPS Tracker</a> Android app on your phone.';
}