Embedded videos don't show up - php

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.

Related

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?

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.

Wordpress- <iframe> is incorrectly interpreting url page content

I'm trying to embed a vimeo player in my Wordpress 3.8 site. To make changing the video a little easier, I've created Page which just contains the url for a Vimeo video. On the site, I try to embed the video like so:
<iframe allowfullscreen="" frameborder="0" mozallowfullscreen="" src="<? echo apply_filters('the_content', get_page(925)->post_content); ?>" webkitallowfullscreen=""></iframe>
But when I view the site, it just loads an empty page template inside the frame! When I echo that php chunk outside the iframe, however, it returns the url as expected. Putting in the url directly causes it to work fine, and I've tried a ton of quotation configurations to make sure the error wasn't there. Any idea what is causing it to wig out?
why are you running apply_filters on this? Also, get_page is deprecated.
Try something like this:
<?php
$vidPost = get_post(925);
echo '<iframe allowfullscreen="" frameborder="0" mozallowfullscreen="" src="'.$vidPost->post_content.'" webkitallowfullscreen=""></iframe>';
?>

Passing Params to Wufoo iframe

Ok so there are tons of examples on how to pass custom parameters hidden fields in Wufoo forms (in my case the current URL of the form). The problem is these all deal with the javascript embed code. I'm working with a company whos custom backend won't allow the js embed and therefore I must use the iframe embed method. I cannot for the life of me figure out how to do this. There are a couple frustratingly close examples that mention using PHP successfully but never show the actual implementation. Can anyone tell me how to do this or point me in the right direction? Relevant info:
I currenlty have a field that is hidden using css. I want that field to be populated with the url or some part of the url it could be www.host.com/thepage or just /thepage as long as we can see where on the site the user submitted the form
http://help.wufoo.com/articles/en_US/SurveyMonkeyArticleType/URL-Modifications <- the page every post I've read mentions. http://www.wufoo.com/forums/discussion/3349/how-to-pass-dynamic-value-into-embedded-forms/p1 <- example using php but with javascript embed methodExample iframe embed code:<iframe height="763" allowTransparency="true" frameborder="0" scrolling="no" style="width:100%;border:none" src="https://username.wufoo.com/embed/formid/">Fill out my Wufoo form!</iframe>
It seems the appropriate way is to use the URL method.
Adding "def/" at the end of your src, then any arguments you wish to pass.
For example, if I wanted to disable secure SSL, I'd use:
<iframe height="763" allowTransparency="true" frameborder="0"
scrolling="no" style="width:100%;border:none"
src="http://username.wufoo.com/embed/formid/def/secure=false">
...
Additional parameters can be added using the '&' character.
(note that I also changed https for http)
In fact, if you already have a javascript example of what you want, the only thing javascript does is add this iframe for you, so if you can run it in your browser (by making a local HTML file, for example) using Inspect Element and navigating to the created iframe element, you can copy and paste the resulting code to your site, tweaking as desired.
Regarding PHP, all they mean is to construct the URL using things like echo or print. For example:
<iframe height="763" allowTransparency="true" frameborder="0"
scrolling="no" style="width:100%;border:none"
src="https://username.wufoo.com/embed/formid/def/fieldx=<?php echo $the_url; ?>">

How to Show google map?

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.

Categories