<?php if($_POST){ print_r($_POST); exit; } ?> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Google Maps JavaScript API v3 Example: Map Simple</title> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places"></script> <script type="text/javascript"> var placeSearch,autocomplete; var component_form = { 'street_number': 'short_name', 'route': 'long_name', 'locality': 'long_name', 'country': 'long_name', 'postal_code': 'short_name' }; function initialize() { autocomplete = new google.maps.places.Autocomplete(document.getElementById('autocomplete'), { types: [ 'geocode' ] }); google.maps.event.addListener(autocomplete, 'place_changed', function() { fillInAddress(); }); } function fillInAddress() { var place = autocomplete.getPlace(); var lat = place.geometry.location.lat(); var lng = place.geometry.location.lng(); for (var component in component_form) { document.getElementById(component).value = ""; document.getElementById(component).disabled = false; document.getElementById("long").value = lng; document.getElementById("lat").value = lat; } for (var j = 0; j < place.address_components.length; j++) { var att = place.address_components[j].types[0]; if (component_form[att]) { var val = place.address_components[j][component_form[att]]; document.getElementById(att).value = val; } } } function geolocate() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var geolocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude); autocomplete.setBounds(new google.maps.LatLngBounds(geolocation, geolocation)); }); } } </script> </head> <body onload="initialize()"> <div id="locationField"> <input id="autocomplete" placeholder="Adresinizi Giriniz" onFocus="geolocate()" type="text"></input> </div> <form action="streetfindexportinput.php" method="post"> Sokak No:<input id="street_number" disabled="true"/><br> Güzergah:<input id="route" disabled="true"/><br> Semt:<input id="locality" disabled="true"/><br> Posta<input id="postal_code" disabled="true"/><br> Ülke<input id="country" disabled="true"/><br> <input type="hidden" name="lng" id="long" /> <input type="hidden" name="lat" id="lat" /> <button type="submit">Gönder</button> </form> </body> </html>