0

First of all, Sorry coz this question has been asked many times in SO.But I am not able to find it working with mine.That's why I am posting here.

I have below script at the end of the file:

<script type="text/javascript">
$(document).ready(function(){
var pos = new google.maps.LatLng(position.coords.latitude,
                                   position.coords.longitude);
 });
 </script>

I want to use that var pos at the top of that php file.

I have tried like this :

<script type="text/javascript">
//this script at bottom
$(document).ready(function(){
var pos = new google.maps.LatLng(position.coords.latitude,
                                   position.coords.longitude);
 });
 </script>

<?php
//this part at the top of the file 
if (isset($_GET['coordinates'])) {
    echo $_GET['coordinates'];
}
//I have tried with $_POST['coordinates'] ..but still no Echo
?>

Can any one help me out ?

Twix
  • 387
  • 3
  • 15

0 Answers0