title: How to pass parameters to URL and retrieve with PHP?
body: <p>I noticed that there are a lot of these questions but I can't find something that relates to my particular project. I am building a Instagram and Google maps app. What I'm trying to do is I'm pulling all JSON format endpoints from Instagram with PHP. With Google maps, I'm adding the longitude and latitude coordinates that this certain API call passes through so you can see where the user has taken the photo at the time it was created. What I'm working on is using <a href="https://developers.google.com/maps/documentation/javascript/events" rel="nofollow">Google's event methods</a> I am able to center longitude and latitude coordinates to the URL using the function <code>parent.location.hash</code>. </p>
  
  <pre><code> google.maps.event.addListener(map, 'center_changed', function(){
          var control_center = map.getCenter();
          var lng = control_center.lng();
          var lat = control_center.lat();
          parent.location.hash="&amp;lng="+lng +"&amp;lat="+lat;
          $('.lng').append(lng);
          console.log(map.getCenter());
          console.log(lng +', ' +lat);
        }); 
  </code></pre>
  
  <p>The issue I'm now running into is when I tried to retrieve lng and lat with PHP <code>$_GET</code> it was not working. I found out because it's a fragment and it never gets sent to the server. I found other tips and tricks like <code>parse_url</code> but that echos one string. Here is a snippet of what the current URL looks like when someone has done a search and moving Google maps around in the viewport -> <code>api.php?location=houston#&amp;lng=-95.34908043923292&amp;lat=29.74942788453117</code>. </p>
  
  <p>The concept behind this API mashup is you have a search box, and you type in Houston, TX. Google maps will load and a feed from Instagram with display that have coordinates that are within Houston, Tx. The map will show where exactly where those photos taken. You move the map and we want more Instagram photos to show up but I can't pass the lng and lat variables to <a href="https://instagram.com/developer/endpoints/media/#get_media_search" rel="nofollow">instagrams api</a>. This is a bit of a long one, sorry. </p>
  
  <p><a href="http://pastebin.com/DUxcd736" rel="nofollow">Pastebin</a></p>