English 中文(简体)
用山角地图扫描仪向我的SQL数据库发送了现有的坐标。
原标题:Send current gps coordinates to mySQL database using google maps api

我正试图在jquery建造一个高尔夫球场,在那里,我可以把目前的浮雕坐标送到一个使用纽子的我的SQL数据库。

The problem is that I am new to php and I am trying to find code that i can use. I have built a database:

  1. ID int 3 autoincrement
  2. LAT float 10
  3. LON float 10

一个人能否得到某些html和php代码的帮助?

<!DOCTYPE html>
<html>
<body>
    <div data-role="page" id="page1">
        <div data-theme="b" data-role="header" data-position="fixed">
            <h5>
                Play 9 holes
            </h5>
        </div>
    </div>
<p id="demo">Click the button to get your position:</p>
<button onclick="getLocation()">Try It</button>
<div id="mapholder"></div>
<script>
var x=document.getElementById("demo");
function getLocation()
  {
  if (navigator.geolocation)
    {
    navigator.geolocation.getCurrentPosition(showPosition,showError);
    }
  else{x.innerHTML="Geolocation is not supported by this browser.";}
  }

 function showPosition(position)
  {
  var latlon=position.coords.latitude+","+position.coords.longitude;

  var img_url="http://maps.googleapis.com/maps/api/staticmap?center="
   +latlon+"&zoom=14&size=400x400&sensor=false";
   document.getElementById("mapholder").innerHTML="<img src= "+img_url+"  />";
   }

 function showError(error)
  {
   switch(error.code) 
     {
   case error.PERMISSION_DENIED:
      x.innerHTML="User denied the request for Geolocation."
       break;
     case error.POSITION_UNAVAILABLE:
       x.innerHTML="Location information is unavailable."
        break;
     case error.TIMEOUT:
       x.innerHTML="The request to get user location timed out."
        break;
     case error.UNKNOWN_ERROR:
         x.innerHTML="An unknown error occurred."
       break;
     }
   }
 </script>
 </body>
 </html>

这部法典显示了目前的位置,但必须具备能够向数据库发送立场的要求功能。

问题回答

我确实不敢肯定你努力做些什么,但这里在谷歌地图普森网站用PHP和MySQL与谷歌地图APIC中有一些文章:

https://developers.google.com/maps/articles/phpsqlajax_v3

https://developers.google.com/maps/articles/phpsqlinfo_v3





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签