forked from GwakoSyprose/TORS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeolocation.php
41 lines (29 loc) · 906 Bytes
/
geolocation.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body onload="getLocation()">
<p id="demo"></p>
<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) {
var lat=position.coords.latitude;
var lng=position.coords.longitude
// window.location.href='loc.php?lat='+lat+'&lng='+ lng;
document.getElementById("iframeid").src = 'loc.php?lat='+lat+'&lng='+ lng;
// show button function here
document.getElementsByClassName("showButton")[0].style.display = "block";
// show button function here
}
</script>
<iframe style="visibility:hidden;position:absolute;height:0px;" id="iframeid" src=""></iframe>
</body>
</html>