title: Geolocation is working in local but doesn't on remote server
body: <p>I uploaded the web app that I'm working on to a remote server.
  Everything is working good, except for the geolocation. I can't understand what is the problem, beacuse I didn't receive any error message.
  this the HTML code where geolocation is involved.</p>
  
  <pre><code>&lt;tr&gt;
  &lt;td&gt;Ti trovi qui: &lt;span id="location"&gt;&lt;/span&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;input type="hidden" id="latitude" name="latitude"&gt;
  &lt;input type="hidden" id="longitude" name="longitude"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>These are the scripts that I use: (i'm not very prepared with javascript and jQuery)</p>
  
  <pre><code>function showLocation(position) {
  var latitude = position.coords.latitude;
  var longitude = position.coords.longitude;
  jQuery.ajax({
      type:'POST',
      url:'getLocation.php',
      data:'latitude='+latitude+'&amp;longitude='+longitude,
      success:function(msg){
          if(msg){
              jQuery("#location").html(msg);
          }else{
              jQuery("#location").html('Not Available');
          }
      }
  });
  }
  
  function getUserCoordinates(position){
  
  var latitude = position.coords.latitude;
  var longitude = position.coords.longitude;
  document.getElementById('latitude').value=latitude
  document.getElementById('longitude').value=longitude
  
  }
  
  jQuery(document).ready(function(){
  if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(getUserCoordinates);
      navigator.geolocation.getCurrentPosition(showLocation);
  } else { 
      jQuery('#location').html('Geolocation is not supported by this    browser.');
  }
  });
  </code></pre>
  
  <p>This is getLocation.php file (but I don't think it's the problem):</p>
  
  <pre><code>&lt;?php
  
  require_once 'metodi.php';
  
  sec_session_start();
  
  if(login_check() == true){
  if(!empty($_POST['latitude']) &amp;&amp; !empty($_POST['longitude'])){
  
      $_SESSION['latitude'] = $_POST['latitude'];
      $_SESSION['longitude'] = $_POST['longitude'];
      //Send request and receive json data by latitude and longitude
      $url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng='.trim($_POST['latitude']).','.trim($_POST['longitude']).'&amp;sensor=false';
      $json = @file_get_contents($url);
      $data = json_decode($json);
      $status = $data-&gt;status;
      if($status=="OK"){
          //Get address from json data
          $location = $data-&gt;results[0]-&gt;formatted_address;
      }else{
          $location =  '';
      }
      //Print address
      echo $location;
  }
  } else {
      echo "Non sei autorizzato a visualizzare questa pagina. Effettua il login.";
  }
  
  ?&gt;
  </code></pre>
  
  <p>Then I grab the value of hidden inputs in another php file.</p>