I have the following code:
<script type="text/javascript" src="../scripts/jquery-1.11.0.min.js"></script>
<script type="text/javascript">
var Location_lat;
var Location_lng;
function showMap(position) {
Location_lat=position.coords.latitude;
alert(Location_lat);
}
navigator.geolocation.getCurrentPosition(showMap);
<?php
$Location_lat="<script>document.write(Location_lat)</script>"?>
</script>
<?php echo 'php_'.$Location_lat;?>
When executed, the alert returns the good value but $Location_lat is undefined. Any help? Thanks