EvilZone
Programming and Scripting => Web Oriented Coding => : DeXtreme April 26, 2013, 06:39:13 PM
-
I've been trying to embed external webpages in my webpage but the iFrame ends up blank. Tried with the object tag and embed tag but had the same result.I did some research and found out that some pages send "Deny" response when you try to iFrame them. So i ask you gentlemen if there is a workaround for this problem..
-
Try a modal window library, such as Lightbox. Of course this will end up overlaying the web page, but you can modify it to be less of an obtrusion.
-
Thanks a lot.i'll be sure to read about it but is this the only alternative?
-
I have little knowledge on this, but check out php file_read_contents and readfile().
-
Thanks..will do
-
Presuming you're using PHP, do something like this in your script:
if(!empty($_GET['get_page'])) {
if(!filter_var($_GET['get_page'], FILTER_VALIDATE_URL)) {
// Not a URL.
exit;
}
$page = file_get_contents($_GET['get_page']);
if($page === false) {
die('Page request filed.');
}
echo file_get_contents($_GET['get_page']);
}
Make sure you have set "allow_url_fopen" to 1 in your PHP config.
Then just call "whatever_page_you_put_the_code_in.php?get_page=http://blah.com/blah.php" instead of the website.
Just note that some websites forbid visitors who have no UA from accessing the site, and this can be easily abused as it is pretty much a proxy.
Might not work, but it's worth a try.
-
Thank you very much but i'm not really conversant with PHP. Do you happen to know a sloution in javascript?
-
Thank you very much but i'm not really conversant with PHP. Do you happen to know a sloution in javascript?
Not that I know of.
http://en.wikipedia.org/wiki/Same_origin_policy (http://en.wikipedia.org/wiki/Same_origin_policy)
Alternatively, you could use Java or Flash to display the page.