jrobles Posted April 3, 2010 Share Posted April 3, 2010 I'm working on a moble site designed for iphones and I need to be able to capture location coordinates using the iphones gps. i found a script that can get me the coordinates but I am not sure how to take these coordinates and place them in php vars so i can enter them into the database here is the code used to get the current location: <script> navigator.geolocation.getCurrentPosition(foundLocation, noLocation); function foundLocation(position) { var lat = position.coords.latitude; var long = position.coords.longitude; alert('Found location: ' + lat + ', ' + long); } function noLocation() { alert('Could not find location'); } </script> any suggestions on getting this script to talk to php? Link to comment https://forums.phpfreaks.com/topic/197437-using-javascript-to-populate-php-variable/ Share on other sites More sharing options...
Rustywolf Posted April 3, 2010 Share Posted April 3, 2010 i would say using AJAX http://w3schools.com/ajax/ can helkp you get started. Link to comment https://forums.phpfreaks.com/topic/197437-using-javascript-to-populate-php-variable/#findComment-1036266 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.