Results 1 to 4 of 4

Thread: [RESOLVED] Google map link in table

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2003
    Posts
    259

    Resolved [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.

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    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.
    Like Archer? Check out some Sterling Archer quotes.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2003
    Posts
    259

    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?

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2003
    Posts
    259

    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
  •  



Click Here to Expand Forum to Full Width