StirCrazy Posted January 16, 2007 Share Posted January 16, 2007 How would I go about printing the html of a webpage hosted on another server?E.G:-[code]$url_to_output = "http://www.domain.com/page123.php";<!-- some function to output html rather than run it -->echo $page_html;[/code]Regards,S.C> Link to comment https://forums.phpfreaks.com/topic/34476-outputting-html-as-text/ Share on other sites More sharing options...
JasonLewis Posted January 16, 2007 Share Posted January 16, 2007 ok, well this should work. it just grabs the contents of the file and replaces all html characters. but to me it would all come out as jumbled and i dont think it would work for php, not sure. here:[code=php:0]$file = "http://www.phpfreaks.com/forums/index.php?topic=122711.0";$contents = file_get_contents($file);echo htmlentities($contents);[/code] Link to comment https://forums.phpfreaks.com/topic/34476-outputting-html-as-text/#findComment-162435 Share on other sites More sharing options...
StirCrazy Posted January 17, 2007 Author Share Posted January 17, 2007 perfect.. just what i needed :DThanks for your helpS.C> Link to comment https://forums.phpfreaks.com/topic/34476-outputting-html-as-text/#findComment-162469 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.