0
我想要在我的网站申请这个例子 here example力地理位置在PHP我的网站
我尝试使用最近的地方,用户谁登录到我的网站
我需要得到经度纬度的值时,页面加载..如果你想允许或拒绝
,我怎么能使用此代码的PHP
<script>
var x = document.getElementById("demo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
x.innerHTML = "Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude;
}
</script>