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
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]

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.