#1
  1. No Profile Picture
    Francine
    Guest
    Devshed Newbie (0 - 499 posts)
    Can you use php to create html files? If so, how? Thanx.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Seattle, WA,USA
    Posts
    84
    Rep Power
    14
    Yes, using fputs() or fwrite() . Kinda like in perl. I'm not sure what the parimeters are. I'll have to look it up in the manual. If someone knows, please e-mail or post it.

    ------------------
    Jerome Gagner
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    This writes to, or creates if it does not exist already, a file called 'type4.txt'
    it could be 'whatever.html' if you wanted.

    $file = fopen("type4.txt", "w");
    fputs($file,$string);
    fclose($file);

    if you are creating a HTML file you just pass the <hmtl> etc in $string - you just have to escape '' all the special charaters.




    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL
  6. #4
  7. No Profile Picture
    Francine
    Guest
    Devshed Newbie (0 - 499 posts)
    Thank you, but what does the "w" stand for?

Similar Threads

  1. MS Access & mdb files with PHP in LINUX
    By quiquedcode in forum PHP Development
    Replies: 9
    Last Post: February 11th, 2004, 11:06 AM
  2. Converting DOC files to PDF files using PHP
    By necrophagous in forum PHP Development
    Replies: 3
    Last Post: February 6th, 2004, 12:36 PM
  3. Creating xml files using php
    By Welshie21 in forum PHP Development
    Replies: 16
    Last Post: January 30th, 2004, 10:56 PM
  4. Can php be used in html files
    By emzyme in forum PHP Development
    Replies: 3
    Last Post: January 29th, 2004, 01:50 PM
  5. adding images to zip files with php
    By thindery in forum PHP Development
    Replies: 2
    Last Post: January 25th, 2004, 12:55 PM

IMN logo majestic logo threadwatch logo seochat tools logo