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 Link to comment https://forums.phpfreaks.com/topic/7179-solved-get-webpage-contents/ 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] Link to comment https://forums.phpfreaks.com/topic/7179-solved-get-webpage-contents/#findComment-26121 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. Link to comment https://forums.phpfreaks.com/topic/7179-solved-get-webpage-contents/#findComment-26125 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] Link to comment https://forums.phpfreaks.com/topic/7179-solved-get-webpage-contents/#findComment-26132 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! Link to comment https://forums.phpfreaks.com/topic/7179-solved-get-webpage-contents/#findComment-26137 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.