opening src link without iframe - php

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()

Related

Force any Link From Nested Iframe to Open in New Window

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

Get page source of an iframe after loading its contents

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.

Load a page in an iframe using URL or php

I hope this isn't posted anywhere because it's too obvious.
On my website (Robo Co.) I use two iframe elements with the names iframe_r and iframe_l.
I would like to know how to create permalinks to open pages in those iframes that are not included in the src=() element.
What I would imagine the link would be something close to: roboserver.zapto.org/main.php&iframe_r="page_to_load"&iframe_l="page_to_load"
The URL would then forward the values iframe_r="page1" and iframe_l="page2" into the imbedded php which would then load page1 into iframe_r and page2 into iframe_l.
Using the url scheme you used in the page
roboserver.zapto.org/main.php&iframe_r=/left/page.php&iframe_l=/right/page.php
you would author your iframes like so
<iframe id="frameLeft" src="<?= $_GET["iframe_l"] ?>"/>
<iframe id="frameRight" src="<?= $_GET["iframe_r"] ?>"/>
with javascript you could just
document.getElementById("frameLeft").src = "new url";
document.getElementById("frameRight").src = "new url";

Dynamically insert sub id into iframe code

How would i take a sub id from a destination url and have it dynamically inserted into an iframe code before the page or iframe is loaded?
I want to add the subid to be able to track conversions from adsense without having a thankyou/goal page since the iframe stays on the same page.
this is the code i have at the end of my destination url
&subid=campaignname_{keyword}
this is the iframe code where i want the subid to dynamically insert before loading
<iframe border="0" frameborder="0" width="680" height="800" src="http://xxxxxxx.com?PublisherSubID=</iframe>
If I understand correctly, you have a page http://xxxxxx.com?subid=12345 and you want to take the subid and drop it into the url of your iframe source.
Try this:
<iframe border="0" frameborder="0" width="680" height="800" src="<iframe border="0" frameborder="0" width="680" height="800" src="http://xxxxxxx.com?PublisherSubID=<?php echo $_GET['subid']; ?>"></iframe>
This will take the subid from the $_GET array of your page and drop it into the source url of your iframe.
This will also include the "campaignname_" text as well. if you want to strip that out, then instead of $_GET['subid'] use str_replace("campaignname_","",$_GET['subid']);

PHP open link in iframe

I have the following code presently:
if(isset($_POST['Movie']))
{
$check = $_POST['Movie'];
echo "(left angle bracket)a target='imdb' href='http://www.google.ca/search?hl=en&source=hp&fkt=3948&fsdt=45174&q=$check imdb&btnI=I%27m+Feeling+Lucky&meta=&aq=f&oq='>IMDB PREVIEW";
}
This gives me a link to click which when I do click opens in an iframe called imdb.
How do I cut out the middle man (having to click the link) and just have this link open directly in the iframe.
I already have an iframe named imdb and I want to display the link in there.
**What I ended up doing was just to echo a new iframe with the same class as the other iframe so that the end user will not know that they are different iframes.
You did not include the source for the iframe itself, but basically, all you have to do is echo the URL into the iframe's src attribute:
echo '<iframe id="imdb" src="'.'http://www.google.ca/search?hl=en&source=hp&fkt=3948&fsdt=45174&q=$check imdb&btnI=I%27m+Feeling+Lucky&meta=&aq=f&oq="></iframe>';
I don't know if I understood your question, but maybe you want to do this:
echo '<iframe src="http://www.google.ca/search?hl=en&source=hp&fkt=3948&fsdt=45174&q=$check imdb&btnI=I%27m+Feeling+Lucky&meta=&aq=f&oq=" />';

Categories