How to Show google map? - php

I am trying to show a google map using the following code:
<embed height="400" width="600" src="http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=110069293083852065946.00047e2506156dd8d127b&ll=27.727526,85.310855&spn=0.021197,0.038581&z=14&iwloc=00047e251edcecb28ba7c&output=embed">
It works fine and shows the map correctly in my chrome browser by it shows missing plugin in firefox browser.
What is wrong with this? Is the code itself wrong?

Try using an iframe, not sure where that embed tag came from.
<iframe width="400" height="600" src="http://maps.google.com/maps/ms?ie=UTF8&hl=en&msa=0&msid=110069293083852065946.00047e2506156dd8d127b&ll=27.727526,85.310855&spn=0.021197,0.038581&z=14&iwloc=00047e251edcecb28ba7c&output=embed"></iframe>

There's plenty of documentation on this:
http://code.google.com/apis/maps/documentation/javascript/basics.html
I've never seen it use embed, usually you just create it using JavaScript assign it to a div tag.

Related

PHP Snipped not rendering in iframe

I'm trying to open the user_url within an iframe on a private user page in Wordpress.
I put the following code into a snippet:
<?php echo get_the_author_meta('user_url',$userID); ?>
When I use the short code on the user page it does display the user URL, I can also use it in an hyperlink like this:
link text
But when I put the short code into an Iframe the short code does not change into the URL anymore.
<iframe src="[cmruncode name='dash']" height="300" width="300" title="Iframe"></iframe>
Does anyone knows why this is not working and know a solution?
Thanks Peter
If you are using WordPress shortcode then you have to call shotcode using function do_shortcode.
You can try this one
<iframe src="<?php echo do_shortcode( '[cmruncode name="dash"]' ); ?>" height="300" width="300" title="Iframe"></iframe>
And I'm not sure why anchort text display right output. That's weird.
Anyway if you used do_shortcode to output your shortcode then it will work every place.
This only works when I put it directly into the template, in that case no snippet-shortcode is needed at all. But the content needs to be hidden when the user is logged-out.
Normally the plugin "client portal" that I use should take care of this
but it has a content block that does not support PHP and also does not render the php snippet that I made.
Any suggestions?
The solution was to put the iframe code completely into a snippet.
Like this:
<iframe src="<?php echo the_author_meta('user_url',$userID); ?>" height="2400" width="100%" title="Iframe"></iframe>

Getting dynamic PHP links and iframe to work?

I'm creating a wordpress theme and am having trouble generating a video link to go into an iframe source. I've tried troubleshooting and it seems that the issue is beyond wordpress and I can't actually input any link with PHP to work with iframe. Here's an example for simplicity's sake.
<iframe src="<?php echo 'https://vimeo.com/159120552'; ?>" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
The PHP works as far as I can tell (when I inspect it, the link is in the correct place), but there appears to be a blank web document created in the iframe instead.
Am I doing something wrong or is this a known issue of iframe and PHP?
This issue not related to PHP . Its throwing an error refused to display in a frame because it set 'X-Frame-Options' to 'sameorigin'.
Please refer How to set 'X-Frame-Options' on iframe?

display files from onedriver in iframe

I use iframe to view files from onedriver on my web app php.
it works fine before, but recently I can not, I have tried many ways but no result
This is code for my file php
<iframe src="https://onedrive.live.com/view.aspx?cid=ca91cd81c0fee9e6&resid=CA91CD81C0FEE9E6%21262&app=Word&authkey=%21AJHFjDm4aQXDEb4&wdo=1" frameborder="0" width="100%" height="100%"></iframe>
I was wrong place, everyone helps me!
On the document, right click and select: "embedded".
It will generate an iframe for you.
More information

Loading iframe (google map) stored in variable loaded from mysql into a div from link

I have been trying ot hunt this down all afternoon, Im pretty new to all this and am building my first site with php
what Im trying to do is I have a google maps embed code stored in a Db which I have assigned to a variable $map, I want to inject the embed code into an existing div.
So basically a click here for map. I may be way off on what I can do here.
Im sure there is a fancier way to do this but Im just learning and trying something simple.
Sorry if this is something that is obvious.
I have no code to show as i have murdered it and it is an unhelpful mess now.
If the page has already been served to the user, you'll need to use javascript to update the div, or reload the page. I jQuery's .post method to dynamically refresh divs with using AJAX. Info at http://api.jquery.com/jQuery.post/.
I use the following code on my website, which sounds similar to what you're trying to do, but in my case, I'm passing the address to the embed code in the $addresssubjectfullgoogle variable:
<iframe width="100%"
height="350"
frameborder="1"
scrolling="no"
marginheight="0"
marginwidth="0" src="
https://maps.google.com/?f=q&t=h&ie=UTF8&output=embed&q=<?php echo $addresssubjectfullgoogle;?>&z=18&ll=<?php echo $addresssubjectfullgoogle;?>&ie=UTF8">
</iframe>
I suspect that you could do something similar except that in your case, the same could might look something like this:
<iframe width="100%"
height="350"
frameborder="1"
scrolling="no"
marginheight="0"
marginwidth="0" src="<?php echo $map;?>">
</iframe>
I hope that's helpful.

Embedded videos don't show up

I have a web site I'm working on and for some reason some of my videos don't display. The first videos display but the next one's don't.
So first one looks like this:
And the rest look like this:
I know the url's I am using are correct, I dump them to the screen and navigated to them to make sure they weren't broken. This is in chrome, same thing happens in IE.
This is the code I am using to embed:
<iframe width="420" height="315" alt="Jesus Culture" src="<?=$row?>"
frameborder="5" allowfullscreen></iframe>
I'm using similar code to yours for multiple videos on one page,
i.e.
<iframe width="425" height="349" src="http://www.youtube.com/embed/video-code" frameborder="0" allowfullscreen=""></iframe>
Make sure that your urls have the embed format. Also try to place the src value hardcoded (no php) to check whether in that case displaying multiple videos on the page will be an issue.

Categories