I have done a bit of Php, mysql & Html programing but haven't done anything with javascript. I have been looking online but haven't found out how to do this. Below is code that gets the current users GPS and shows it on the page . I need to be able to take the GPS coordinates and insert it into my Mysql Database. I know how to insert php into a mysql database but I have no clue how to get the Javascript GPS coordinates into my database. Any help would be much appreciated.
I hope this makes sense but if you are confused please let me know?
<script language="javascript" type="text/javascript">
function getLocation() {
// Get location no more than 5 minutes old. 300000 ms = 5 minutes.
navigator.geolocation.getCurrentPosition(showLocation, showError, {enableHighAccuracy:true,maximumAge:300000});
}
function showError(error) {
alert(error.code + ' ' + error.message);
}
function showLocation(position) {
geoinfo.innerHTML= position.coords.latitude + ',' + position.coords.longitude;
}
</script>
<body onload="getLocation()">
<div id="geoinfo"></div>
</body>