I don\'t know why my code is not working, I am trying to send the coordinates from JavaScript to PHP using AJAX and I am able to pull values from JavaScript to textbox but v
You can not execute the PHP script on the samepage3.php, after the page is fully loaded. I suggest to separate the page, and create the response using AJAX. Something like this.
File index.php
File response.php
';
}
if (isset($_POST["getlon"]))
{
$lon = $_POST["getlon"];
echo 'Longitude : ', $lon;
}