<script>
var x = document.getElementById("latitude");
var y = document.getElementById("longitude");
function getLocation()
{
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
y.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position)
{
x.innerHTML = "Latitude: " + position.coords.latitude;
y.innerHTML = "Longitude: " + position.coords.longitude;
}
I need to store the X and Y value in variable in the data in SQL database and also display inside the php.