I am scraping a video URL from an iframe. I am using file_get_contents('iframe_url'). But I am getting only contents before page load.
For example,
<textarea><?php echo file_get_html('https://www.xvideos.com/embedframe/26922703'); ?></textarea>
I am getting only
<img src='http://static-ss.xvideos-cdn.com/v3/img/skins/default/xvideos.com.png' /><div style='background-color: #FFF'><h1>Please find this video on <a href='https://xvideos.com' target='_blank'>xvideos.com</a> or <a href='https://xvideos.net' target='_blank'>xvideos.net</a></h1></div>
But when I right-click on the iframe and click view frame source, then I get the full page source.
So, how to get the iframe page source using PHP after loading its javascript document.
Any help is appreciated.
Related
I am displaying some 3rd party banners inside an Iframe which are loading through javascript. Banners are showing inside iframe and links are openning to new window when I browse the url myself. Problem is when I am trying to advertise the url to different ptc sites. Basically this site show url inside iframe. so when my url which is itself an iframe loading inside another iframe, clicking not working. Below is my current code
<base target="_blank"> //in head section
<iframe sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-downloads" src="<?php echo $_SESSION['ad_url'];?>" frameborder="0" id="pgl" name="pgl" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%" onmouseover="on_mouseover(this)" onmouseout="on_mouseout(this)"></iframe>
As i see the source of the page that embeds my iframe found below code
<iframe sandbox="allow-same-origin allow-scripts allow-forms" id="surfsite" name="surfsite" src="https://sitename.com/sitename.php?" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
how can I make this working
I am working on a php youtube clone script, similar to playit.pk
If you have experience with such a script then you could probably help me.
On th page watch.php where an iframe is used to view youtube video in the iframe the php source code is:
src="//www.v.ytapi.com/embed/<?php echo $yt->id ?>
but I want to replace it with
src="//www.myDomainName.com/embed/<?php echo $yt->id ?>
How can I achieve that or else Instead of iframe how can I get src like this
http://r5---sn-vgqs7n7y.c.docs.google.com/videoplayback
and directly use it in a video tag.
Is there any way i can load PDF file (its contents) in a div or iFrame?
I have a bunch of PDF files on a server and, ideally, i need to have a button 'Show file' on a page, clicking on which will load the contents of selected file in a div(iFrame).
You can also use google pdf view by using iframe on your page :
<iframe src="http://docs.google.com/gview?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>
Instead of this in above code :
http://infolab.stanford.edu/pub/papers/google.pdf
Use your own PDF file path.
You can view the demo here.
http://googlesystem.blogspot.in/2009/09/embeddable-google-document-viewer.html
It's just a suggestion. No downvotes please.
Google's gview is sometimes unresponsive and given 204 status. Here is the best free alternative.
https://stackoverflow.com/a/66548544/2078462
is there a method to open src link without iframe?
i have a script with this code:
<td><a target="_blank" style="margin-right:3px;" href="download/id/<?=$dl['id']?>"><?=$dl['title']?></a></td>
when a user clicks, it open the link using the following code:
<iframe onLoad="calcHeight();" scrolling="yes" frameborder="1" width="100%" height="2000" name="resize" id="resize" src="<?=$download['url'] ?>" />
how can i allow the link top open in a full page without iframe src when a user click on?
Instead of rendering a page containing an <iframe> with the target site, you could simply redirect the user to the target URL:
<?php
header('Location: '.$download['url']); ?>
Note: There must be no other output sent to the browser before the header()
I'm trying to construct a table on the right of the page where I pull out all the videos from the server. I want the users to click a row in the table and it starts to play a video in flowplayer on the left of the page. The video url is something I pull out of the DB.
<?php
for($i=0;$i<$num_videos;$i++)
{
?>
<tr onclick="DoNav('<?php echo $result_videos[$i]["video_url"]; ?>');">
<td>
...
Here's the javascript:
function DoNav(theUrl)
{
flowplayer("player", "flowplayer/flowplayer-3.2.7.swf", document.location.href = theUrl);
}
For whatever reason I can't seem to get flowplayer to work with this div:
<div id="player"><img src="recordings/landscape.jpg" width="320" height="240" /></div>
It will only prompt you to open or save the video instead of playing in the current window. If anyone knows this issue here that would be appreciated. At any rate, I know I can get flowplayer working with a href like so:
<a
href="url"
style="display:block;width:320px;height:240px;"
id="player"><img src="recordings/landscape.jpg" width="320" height="240" />
</a>
But I don't want to put the href in the table as I want that splash image included as well. Any ideas?
Edited to improve clarity.
When the function flowplayer("player", "flowplayer/flowplayer-3.2.7.swf", document.location.href = theUrl); Was called the document.location.href was being evluated and caused the browser to go to the theUrl which prompted for file to be downloaded.
Furthermore we found there is some sort of issue updating a with the as a child DOM object. This was solved by moving the image to the background of the using the inline CSS.
JS Code:
function DoNav(theUrl)
{
flowplayer("player", "flowplayer/flowplayer-3.2.7.swf", theUrl);
}
HTML table:
<div id="player" style="display:block;width:320px;height:240px;background-image:url(recordings/landscape.jpg)"></div>
PHP stayed the same.