Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Address in PHP variable, Google Maps embedding without Javascript?

I consider myself to be an average PHP coder, but I can barely edit the few bits of JavaScript code that I need on my websites. I have an address in a PHP variable and I would like a simple map to show up on my webpage with that address. I've done some research on the internet and I find a lot op geocoding, converting an address to a location the Google API understands, but I'm completely lost. Is there no simple piece of code to in which I can embed my variables?

like image 267
user1555076 Avatar asked Aug 25 '12 15:08

user1555076


1 Answers

You can use an iframe and pass the address as an URL parameter.

<iframe width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.it/maps?q=<?php echo $yourAddress; ?>&output=embed"></iframe>
like image 90
napolux Avatar answered Sep 20 '22 17:09

napolux