Jump to content

Archived

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

BladeMetal

*SOLVED* GET WEBPAGE CONTENTS

Recommended Posts

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

Share this post


Link to post
Share on other sites
[!--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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Yes use htmlentites:
[code]print htmlentities($website);[/code]

Share this post


Link to post
Share on other sites

×

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.