Hi All,
before you ask I have read all the post regarding "passing php vars to javascript" and I cannot find the solution to my problem.
PROBLEM
I have the following code:
<a href="http://www.mydomain/location_map.php?lat=<?php echo $row_accomm_counties['lat']; ?>&lon=<?php echo $row_accomm_counties['lon']; ?>
As you ca see the url apends the content of the 2 vars:
$row_accomm_counties['lat'];
$row_accomm_counties['lon'];
CALLED PAGE (location_map.php)
This page just has javascript in it:
<script type="text/javascript">
//<![CDATA[
var map = new GMap(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.centerAndZoom(new GPoint([COLOR=Red]-4.437103271484375[/COLOR], [COLOR=Red]55.86250064959305[/COLOR]), 4);
//]]>
</script>
WHATS REQUIRED
As you can see the javascript has 2 set of map references:
-4.437103271484375 ( lon )
55.86250064959305 (lat )
Is there a way I can use the 2 PHP vars
$row_accomm_counties['lat']
$row_accomm_counties['lon']
and sub them for the 2 map references.
I'm ok'ish at PHP but not so good with javascript.
I have not place the PHP holders because in this case it makes the code not so readable.
Can anyone help please.