I have an array of coordinates (latitude and longitude) in one .php script and want to pass these values to maps.php which will display a google map and plot these values passed (i.e. latitude and longitude coordinates) on the map.
My question is that, is it possible to pass these values to maps.php when clicking on
<a href="maps.php"> view map </a> ???
Thanks
You can serialize your array, and then pass it in a GET parameter. For instance:
Now in your maps.php, you need to unserialize, and you can interact with the array as you normally would:
This method would be ideal for passing a lot of values in a single GET parameter. If you’re passing only one value, then you may be better off just setting two GET parameters, one for the longitude and one for the latitude.
Also note, that I didn’t test any of this code as I didn’t have time, but the concepts should be correct.