#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Hong Kong
    Posts
    24
    Rep Power
    0
    Hi guyz,

    I need to write a PHP program which can perform the following tasks:

    1. read a HTML file from a given url, and generated another HTML using the content from the original HTML file.

    I just wonder is fopen() is the only function can use in here?
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    you can use file() to grab local files if you can get your host to cache them for you , but at the end of the day the fun stuff is still going to be grabbing the content you want out of the file however you cache it. fopen()/fgets() etc are pretty good tools.

    A basic example http://www.firepages.com.au/news.htm

    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    24
    Rep Power
    0
    You can use file() to get the contents of remote files. I used this when i made my guestbook. So what you could so it use file to grab the contents of a file.

    $file=file("http://host.com/file.html");

    then use it to do whatever you need in the rest of the script.

    ------------------
    Aoeex,

    -http://www.aoeex.com

    [This message has been edited by Aoeex (edited August 15, 2000).]

Similar Threads

  1. How to create HTML email with PHP?
    By bubbapuck in forum PHP Development
    Replies: 4
    Last Post: March 8th, 2004, 06:48 PM
  2. XHTML not allowing Transitional w/ PHP HTML
    By PFCritics in forum PHP Development
    Replies: 1
    Last Post: February 16th, 2004, 07:32 PM
  3. Can php be used in html files
    By emzyme in forum PHP Development
    Replies: 3
    Last Post: January 29th, 2004, 01:50 PM
  4. all-in-one php script displaying html
    By emzyme in forum PHP Development
    Replies: 5
    Last Post: January 27th, 2004, 07:07 AM
  5. php n00b. Put a php file into an html template?
    By WorldBuilder in forum PHP Development
    Replies: 3
    Last Post: January 25th, 2004, 08:48 PM

IMN logo majestic logo threadwatch logo seochat tools logo