Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <?php
  2. $nome = $_POST['nome'];
  3. $cognome = $_POST['cognome'];
  4. $tel = $_POST['tel'];
  5. $indirizzo = $_POST['indirizzo'];
  6. //$api = ce082e8dbc88c30d7f2b66d97e3ebeec50145e48;
  7. //echo 'https://maps.query.city/user/maps/' . $nome . $cognome . $api ;
  8. $url1 = 'https://maps.query.city/user/maps/';
  9. <iframe src="'.$url1 '" style="width:250px;height:250px;overflow:scroll;" id="MyFrame"></iframe>;
  10.  
  11. $url = file_get_contents("https://maps.googleapis.com/maps/api/geocode/json?address=".urlencode($indirizzo)."&sensor=false"."&key=AIzaSyBaAtkGMr1cYHdBV2GMHG_f0GPVHRHX_fc");
  12. $response = json_decode($url);
  13.  
  14. if ($response->status == 'OK') {
  15. $latitude = $response->results[0]->geometry->location->lat;
  16. $longitude = $response->results[0]->geometry->location->lng;
  17. echo 'Nome: ' . $nome;
  18. echo '<br />';
  19. echo 'Cognome: ' . $cognome;
  20. echo '<br />';
  21. echo 'Telefono: ' . $tel;
  22. echo '<br />';
  23. echo 'Latitude: ' . $latitude;
  24. echo '<br />';
  25. echo 'Longitude: ' . $longitude;
  26.  
  27. } else {
  28. echo $nome . $cognome .$response->status;
  29. }
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement