daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Mar 20th, 2019 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function showpos(position){
  2.   lat=position.coords.latitude
  3.   lon=position.coords.longitude
  4. var enderDe = (+lat+',' +lon);
  5.      
  6. function showpos(position) {
  7.   lat=position.coords.latitude;
  8.   lon=position.coords.longitude;
  9.   var latlon = JSON.stringify({lat:lat,lon:lon});
  10.   saveLatLon(latlon);
  11. }
  12.  
  13. function saveLatLon(pos) {
  14.   $.post('url/do/teu/php.php',pos,function(data) {
  15.     console.log(data); // aqui voce trata data como quiser
  16.   }
  17. }
  18.      
  19. if (isset($_POST['lat']) && isset($_POST['lon'])) {
  20.     // chamada ao MySQL e tratamento de dados aqui
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top