Saving js variables for Lat/Lng in a google map
I have a map with a marker which can be dragged. Once the user drags the marker, I get new coordinates.
I try to make an AJAX call and put them into the session, but for some reason that does not seem to be working.
The test page is here: http://www.comehike.com/outdoors/parks/add_trailhead.php
And the ajax I have looks like this:
$lat = $_GET['lat'];
$lng = $_GET['lng'];
$_SESSION['trailhead_lat'] = $lat;
$_SESSION['trailhead_lng'] = $lng;
My question is real开发者_JAVA技巧ly, how do I save the lat/lng from the dragged marker location so that I can save to as the coordinates when the form is submitted?
Thanks, Alex
The suggestion in the comments to put the variable into the hidden form fields was much better. Thanks!
精彩评论