Jump to content

how to capture the source HTML in a frame set.


sillysillysilly

Recommended Posts

I would like to have a page that on the left frame contains the buttons needed.  On the right will be a website.  What I need to do then is to hit a button and what ever page is on the right the source code will be put into a string variable.

 

Any help you can be will be greatly appreciated.

I see what you mean...

 

Well, if the Links on the left open the Sites on the right, this may be a little tricky, which is why i told you that you may have to use Javascript or AJAX.

 

However, if you make the links on the left load the whole page instead, then, it will work fine

 

Because the order will be like this...

 

The website URL

The Iframe which shows the website

The Textrea which contains the codes of the website

 

You see what i mean?

 

And since codes are read from up to down, everything will work nicely

Actually, i got an idea...

 

The links on the left will load two Iframes & not just one

 

Iframe1: Shows the website

Iframe2: Contains the Textrea of the codes

 

So, Lets say you are after http://www.example.com

 

Iframe2 will be: http://www.yoursite.com?open=http://www.example.com

 

Therefore, the PHP code which is in Iframe2 will read http://www.example.com and display the codes

 

<?
$contents = file_get_contents($open);
print"<textarea>";
Echo "$contents";
print"</textarea>";
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.