0
I need to pass the return variable inside the alert
and move on to PHP, but everything I’m trying from examples to here, even from the forum, is giving Javascript error:
<?php
$pegar_ip = $_SERVER["REMOTE_ADDR"];
?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
$(document).ready(function() {
$.getJSON("https://ipinfo.io/<?=$pegar_ip;?>/json", function(dados) {
alert (dados.loc);
});
});
</script>
Dusty solution @Samuel, thank you!!!!
– Marcos Paulo