Jump to content

*SOLVED* GET WEBPAGE CONTENTS


BladeMetal

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
Link to comment
https://forums.phpfreaks.com/topic/7179-solved-get-webpage-contents/
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]

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.

Archived

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

×
×
  • Create New...

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.