|
-
Sep 30th, 2010, 07:16 PM
#1
Thread Starter
Hyperactive Member
[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.
-
Sep 30th, 2010, 07:21 PM
#2
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.
-
Sep 30th, 2010, 07:39 PM
#3
Thread Starter
Hyperactive Member
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?
-
Sep 30th, 2010, 07:45 PM
#4
Thread Starter
Hyperactive Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|