Hi all,
I have a problem which is driving me mad and before you shout I know its php and javascript, and should this be here in the first place.
I am passing php vars from page 1 to page 2. Page 2 contains javascript. The vars get passed with no problem. THE SCRIPT :
var map = new GMap(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl( new GMapTypeControl() );
map.centerAndZoom(new GPoint(<?php echo $_GET['lon']?>, <?php echo $_GET['lat']?>), 3);
var icon = new GIcon();
icon.image = "http://www.mydomain/images/maprose.png";
icon.shadow = "http://www.mydomain/mapfiles/shadow50.png";
icon.iconSize = new GSize(20, 34);
icon.shadowSize = new GSize(37, 34);
var marker = new GMarker(new GPoint(<?php echo $_GET['lon']?>, <?php echo $_GET['lat']?>));
map.openInfoWindow(map.getCenterLatLng(),
document.createTextNode("<?php echo $_GET['name']?>")
);
map.addOverlay(marker);
SCRIPT END
As you can see I am passing the var "name" and this works. I also want to pass another var "address1". I have tried writing this in just about every way (but not the right way) without sucess.
This is what I think I require, I want the output from the vars to be on a new line.
map.openInfoWindow(map.getCenterLatLng(),
document.createTextNode("<?php echo $_GET['name']?><?php echo $_GET['name']?>")
Can someone please try and help me with this. Thanks in advance.