[RESOLVED] Google map link in table
i have a table that i display customer addresses that i want to be able to click the words "map it" that will bring up the google map of the address. this works fine but it opens in the same window. i want a seperate window so they dont leave my site
Code:
<td><font size="1" face="Arial, Helvetica, sans-serif"><a href="http://maps.google.com/maps?f=q&hl=en&q=<? echo $address; ?>">map it</a></font></td>
if have tried the target="_self" but i cant get it to work when i have that in. another problem is if the address has a # sign then the google maps only displays up to that point . I typed it manually in a browser and got the same result so maybe thats a limitation.
Re: Google map link in table
use urlencode() to encode the hashes ("#") so that they aren't actually present in the URL, they'd be encoded instead. the target attribute of your anchor tag (<a>) should be "_blank"; "_self" is the current window, which means it works as if you had not used the target attribute at all.
Re: Google map link in table
thanks for the quick reply. blank did the trick. so i got this so far
Code:
<td><font size="1" face="Arial, Helvetica, sans-serif"><a href="http://maps.google.com/maps?f=q&hl=en&q=<? echo $address; ?>" target="_blank">map it</a></font></td>
not sure how to remove the # sign like you said. any pointers?
Re: Google map link in table
Kows,
sorry didnt know that function. i looked it up and got this and it works great thanks to you.
Code:
<td><font size="1" face="Arial, Helvetica, sans-serif"><a href="http://maps.google.com/maps?f=q&hl=en&q=<? echo urlencode($address); ?>" target="_blank">map it</a></font></td>
sean