sillysillysilly Posted February 25, 2009 Share Posted February 25, 2009 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. Link to comment https://forums.phpfreaks.com/topic/146790-how-to-capture-the-source-html-in-a-frame-set/ Share on other sites More sharing options...
npsari Posted February 25, 2009 Share Posted February 25, 2009 You might have to add some Javascript Anyway, you can read the contents of a page in PHP $contents = file_get_contents($page_URL); Echo "$contents"; You can echo them inside a Textarea to disable the codes Link to comment https://forums.phpfreaks.com/topic/146790-how-to-capture-the-source-html-in-a-frame-set/#findComment-770674 Share on other sites More sharing options...
sillysillysilly Posted February 25, 2009 Author Share Posted February 25, 2009 What if the site in the right frame changes due to inputs. for example in the right frame choices are made then based on the link clicked in the right frame url will change (such as get information). Link to comment https://forums.phpfreaks.com/topic/146790-how-to-capture-the-source-html-in-a-frame-set/#findComment-770680 Share on other sites More sharing options...
npsari Posted February 25, 2009 Share Posted February 25, 2009 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 Link to comment https://forums.phpfreaks.com/topic/146790-how-to-capture-the-source-html-in-a-frame-set/#findComment-770753 Share on other sites More sharing options...
npsari Posted February 25, 2009 Share Posted February 25, 2009 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>"; ?> Link to comment https://forums.phpfreaks.com/topic/146790-how-to-capture-the-source-html-in-a-frame-set/#findComment-770759 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.