hello friends I have a question I have this code that locates your coordinates I WANT TO DO IS PASSING these coordinates to a variable PHP MYSQL TO INSERT IN SOMEONE HELP ME I COULD am new at this HERE I LEAVE MY CODE
<html>
<div id="mapa">
</div>
<script type="text/javascript">
var divMapa = document.getElementById('mapa');
navigator.geolocation.getCurrentPosition(fn_ok, fn_error);
function fn_error(){
divMapa.innerHTML='A PROBLEM PLEASE CONTACT ME!!!';
}
function fn_ok(respuesta){
var lat = respuesta.coords.latitude;
var lon = respuesta.coords.longitude;
divMapa.innerHTML = lat+' , '+lon;
}
</script>
<?php
$variablePHP = '<script> document.write(fn_ok()) </script>';
echo $variablePHP;
?>
</html>
THIS ONLY PRINT "undefined" in the php variable
hi from mexicoenter code here