clausowitz Posted July 7, 2011 Share Posted July 7, 2011 I have this code that I use to show a google map in my website. somehow the php variables inside the code don't display their value. When I echo them at the end of the page I do get the values but not inside these lines. Is there a way that I can convert these php variables into something I can just put in there without echoing? "http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=<?php echo "$home_address,+$residence,+$host";?>&ie=UTF8&hq=&hnear=<?php echo "$home_address,+$residence,+$host";?>&z=12&output=embed Marco Quote Link to comment https://forums.phpfreaks.com/topic/241294-convert-php-variables/ Share on other sites More sharing options...
Pikachu2000 Posted July 7, 2011 Share Posted July 7, 2011 Works fine for me. This may sound like a silly question, but are the variables defined before that line? Quote Link to comment https://forums.phpfreaks.com/topic/241294-convert-php-variables/#findComment-1239441 Share on other sites More sharing options...
clausowitz Posted July 7, 2011 Author Share Posted July 7, 2011 You have the same code running? I do define the variables before. I always get the map somewhere in the US but never what i need. Is there anything i can try. Already did the echoing bit. Marco Quote Link to comment https://forums.phpfreaks.com/topic/241294-convert-php-variables/#findComment-1239457 Share on other sites More sharing options...
clausowitz Posted July 8, 2011 Author Share Posted July 8, 2011 Problem solved. My addresses were not recognized by Google Map. Since we live in Egypt the addresses are not always easy to put into Google. Nothing wrong with the code. Marco Quote Link to comment https://forums.phpfreaks.com/topic/241294-convert-php-variables/#findComment-1240002 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.