BladeMetal Posted April 12, 2006 Share Posted April 12, 2006 I know that such a function exists to pull the source code off a website. I've used it before. However, I now can find the function no matter how hard I try. Any help greatly appreciated.And before someone asks, this is not for a malicious purpose. Its just to get data from a website and I have permission to pull it off the source.Thanks in advance!-BladeMetal Quote Link to comment Share on other sites More sharing options...
bonaparte Posted April 12, 2006 Share Posted April 12, 2006 [!--quoteo(post=363928:date=Apr 12 2006, 03:39 AM:name=BladeMetal)--][div class=\'quotetop\']QUOTE(BladeMetal @ Apr 12 2006, 03:39 AM) [snapback]363928[/snapback][/div][div class=\'quotemain\'][!--quotec--]I know that such a function exists to pull the source code off a website. I've used it before. However, I now can find the function no matter how hard I try. Any help greatly appreciated.And before someone asks, this is not for a malicious purpose. Its just to get data from a website and I have permission to pull it off the source.Thanks in advance!-BladeMetal[/quote]If you are looking to pull the HTML source off the web site use[a href=\"http://php.net/file\" target=\"_blank\"]http://php.net/file[/a] Quote Link to comment Share on other sites More sharing options...
BladeMetal Posted April 12, 2006 Author Share Posted April 12, 2006 thanks, that worked a treat!Now I have one more issue. This is my code:[code]<?php$website = file_get_contents("http://www.website.com");print $website;?>[/code]This executes the HTML, but I would like it to display the HTML source on the screen as text rather than trying to display the original site.If this is possible let me know. Thanks. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted April 12, 2006 Share Posted April 12, 2006 Yes use htmlentites:[code]print htmlentities($website);[/code] Quote Link to comment Share on other sites More sharing options...
BladeMetal Posted April 12, 2006 Author Share Posted April 12, 2006 Hi,Thanks heaps. Just what I needed! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.