iframe alternative

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Mehnaz
Forum Newbie
Posts: 20
Joined: Mon Jun 02, 2008 7:49 pm

iframe alternative

Post by Mehnaz »

Hi,

I am using <iframe> to display external web pages. The iframe src is dynamically selected using a php script. For some urls it is working fine but one site(http://medlineplus.go) is restricting site framing. If i use file_get_contents() instead, the output loose all style, images and link information. how could I do this .

Please help

Mehnaz
User avatar
mrvijayakumar
Forum Commoner
Posts: 58
Joined: Tue Aug 18, 2009 12:39 am
Location: Chennai city, India
Contact:

Re: iframe alternative

Post by mrvijayakumar »

Try using, <div> tag for displaying..

<style type="text/css">
<!--
.iframe {
overflow:scroll;

}
-->
</style>

<div class="iframe"></div>
Mehnaz
Forum Newbie
Posts: 20
Joined: Mon Jun 02, 2008 7:49 pm

Re: iframe alternative

Post by Mehnaz »

no <div> doesnt' help.I used the code in this way

Code: Select all

 
<div style="overflow:scroll;">
 
<iframe src=<?php print $selectedUrl; ?> width=100% height=100% frameborder="0"> </iframe> 
</div>
I am stuck . Please help

Mehnaz
User avatar
mrvijayakumar
Forum Commoner
Posts: 58
Joined: Tue Aug 18, 2009 12:39 am
Location: Chennai city, India
Contact:

Re: iframe alternative

Post by mrvijayakumar »

Please try using CURL function, you may get result.

I integrated Div with curl, which u expecting. Please download attachment and try using. You may get exact result.
Attachments
curl.zip
(1.14 KiB) Downloaded 65 times
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: iframe alternative

Post by pickle »

What do you mean by "restricting site framing"? Does the page not work in an iframe because the site checks if it's in the top frame? If that's the case, there's really nothing you can do to get it to show up in the frame. You can have it open in a new window perhaps.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Mehnaz
Forum Newbie
Posts: 20
Joined: Mon Jun 02, 2008 7:49 pm

Re: iframe alternative

Post by Mehnaz »

yes the site is checking for iframe and I think I have to use a pop window instead
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: iframe alternative

Post by John Cartwright »

If they do not want their content hot-linked, then I don't think you should be circumventing their wishes. :evil:
Post Reply