I've got a MySql database that stores (amongst other things) a latitude and longitude for a place. I want to create a hotlink on my page listing that links to a multimap.com map for each record.
For example, for 10 Downing Street London, Multimap use the format:
http://www.multimap.com/map/browse.cgi?client=public&GridE=-0.12659&GridN=51.50324&lon=-0.12659&lat=51.50324&db=GB&scale=5000
In the above example the values I'd need to inject (in 2 places) are -0.12659 and 51.50324
In my database I've got fields called GridLat and GridLong. The existing Code Function from the code I've inherited to display a link from a field that has an URL in it is:
<?php
}
function URLDisplay ($text, $value) {
?>
<tr>
<td width='30%' valign="top" align="right">
<b> <?php echo $text; ?> </b>
</td>
<td align="left" valign="top">
<a href="<?php echo $value; ?>"><?php echo _DOWN_CLICK_TO_VISIT; ?></a>
</td>
</tr>
This function is used to display a link like this:
$this->URLDisplay (_DOWN_FILE_HOMEPAGE, $file->filehomepage);
(Where "_DOWN_FILE_HOMEPAGE" is a language define and "filehomepage" is the fieldname.)
Obviously I'm not just wanting to display the contents of my Lat & Long fields, I want to use them to construct them ultimap URL for a link. Someone has suggested that I use something like:
http://www.multimap.com/map/browse.cgi?client=public&GridE=".$row['GridLat']."&GridN=".$row['GridLong']."
in the link. I've tried putting this in the function but I can't get it to work. It displays part of the url, but NOT with the database values in it.
Am I doing something silly or should I approach this another way?
Cheers.
Simon