Jump to content

using javascript to populate php variable


jrobles

Recommended Posts

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.