Upload files to "/"
This commit is contained in:
44
index.php
Normal file
44
index.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Test av alt</title>
|
||||
<head>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
if(navigator.geolocation){
|
||||
navigator.geolocation.getCurrentPosition(showLocation);
|
||||
}else{
|
||||
$('#location').html('Geolocation is not supported by this browser.');
|
||||
}
|
||||
});
|
||||
|
||||
function showLocation(position){
|
||||
var latitude = position.coords.latitude;
|
||||
var longitude = position.coords.longitude;
|
||||
$.ajax({
|
||||
type:'POST',
|
||||
url:'getLocation.php',
|
||||
data:'latitude='+latitude+'&longitude='+longitude,
|
||||
success:function(msg){
|
||||
if(msg){
|
||||
$("#location").html(msg);
|
||||
}else{
|
||||
$("#location").html('Not Available');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<p>Your Location: <span id="location"></span></p>
|
||||
<p>Lat: <span id="lat"></span></p>
|
||||
<p>Lon: <span id="lon"></span></p>
|
||||
|
||||
<?php
|
||||
|
||||
echo $latlon;
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user