SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    saving a webpage?

    it's a bit hard to explain, but here's what i want to do:

    here's what i want to do:
    1.) Visit a webpage
    2.) copy everything on that page and rename it as file.html

    i actually want to do this on my page. I want the page to load then somehow copy the html code and write it into a file.

    is it possible to do this? can i do something like this:

    $source = file_get_contents("http://www.mysite.com/money.php");
    then do
    fwrite($source).....

    would something like that work?

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    would something like that work?
    Yes. (along with the fopen etc..)

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Posts
    93
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you do the same using relative path?


    $source = file_get_contents ($_SERVER['DOCUMENT_ROOT'].'/test.php');


    can you use file_get_content for the relative path also?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •