Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Mysql Google-map Address Link
Old 07-22-2008, 07:43 AM Mysql Google-map Address Link
Novice Talker

Posts: 7
Name: zeblon
Trades: 0
Hello folk,

Please, I need some help, I am stuck on how to create, a street adress link to google-map from my classified ads web site.

I want my web-site to have the ability to make all street field link to google map, when a user click on the link.

You can see an example of what i mean below:

http://www.loquo.com/pe/housing/room...uilar/10555591


http://www.sitioanuncios.com/espana/...E_EMBARGO.html

Last edited by liquidmind1; 07-22-2008 at 07:44 AM..
liquidmind1 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-22-2008, 09:37 AM Re: Mysql Google-map Address Link
Experienced Talker

Posts: 46
Trades: 0
Try the google map api...

I'm pretty sure you can feed it just about anything and it will figure out where it's suposed to be on the map.

http://code.google.com/apis/maps/
__________________

Please login or register to view this content. Registration is FREE
-> Home of the crasher squirrel
jeff_oneil is offline
Reply With Quote
View Public Profile Visit jeff_oneil's homepage!
 
Old 07-23-2008, 01:06 AM Re: Mysql Google-map Address Link
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
If you just want to link to the map, then you don't need to stress on the API stuff. Just use

http://maps.google.com/?q=

and put the address after the = sign (be sure to urlencode the URL [Google it to get info])

For example, the White House:

http://maps.google.com/?q=1600+Penns...+Washington+DC
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 07-23-2008, 12:22 PM Re: Mysql Google-map Address Link
Novice Talker

Posts: 7
Name: zeblon
Trades: 0
Hello JeremyMiller,

Thanks for responding to my post.

The problem i am having is how to
Automatically url encode the street adress fields and google it to get google info.


I dont know how to do it, will be very glad with some more explanation
liquidmind1 is offline
Reply With Quote
View Public Profile
 
Old 07-23-2008, 12:53 PM Re: Mysql Google-map Address Link
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
In php, try urlencode()
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 07-23-2008, 05:52 PM Re: Mysql Google-map Address Link
Novice Talker

Posts: 7
Name: zeblon
Trades: 0
Hello Miller,

After spending several hours, this is what i got,
The code is working but, it glues the street and city to gether when i click " view map"

Is there any way for me to insert space between street and city for the map to be accurate?

PLEASE, SEE IF THERE IS A BETTER WAY I CAN CODE IT



$l = "http://maps.google.es/maps?hl=es&f=l&q=".urlencode($row['street']) .urlencode($row['city']) ;

$r= $row['street'] ;

echo "<a target=_blank href=$l> $r </a> ";

Last edited by liquidmind1; 07-23-2008 at 06:38 PM..
liquidmind1 is offline
Reply With Quote
View Public Profile
 
Old 07-23-2008, 05:55 PM Re: Mysql Google-map Address Link
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
When posting PHP code, be sure to use the [php] tag so that it gets marked up nicely.

This will help:

PHP Code:
$l "http://maps.google.es/maps?hl=es&amp;f=l&amp;q=".urlencode($row['street']).', '.urlencode($row['city']) ;

echo 
'<a target="_blank" href="',$l,'" > View  Map  </a> '
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 07-23-2008, 05:59 PM Re: Mysql Google-map Address Link
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
urlencode() and stripslashes() are my best friend
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 07-24-2008, 12:57 AM Re: Mysql Google-map Address Link
Novice Talker

Posts: 7
Name: zeblon
Trades: 0
Hello miller,

Thank you very much for helping me out, I don't know with what i should thank you with, cause you have been of great help to me.

I have implemented the code into my classified ads site.
And it working perfectly all right.


Thanks again, you are the best.
liquidmind1 is offline
Reply With Quote
View Public Profile
 
Old 07-24-2008, 01:31 AM Re: Mysql Google-map Address Link
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Glad to help. Talkupation is always appreciated.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Reply     « Reply to Mysql Google-map Address Link
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30353 seconds with 12 queries