views:

187

answers:

3

I'm trying to build a blog/messageboard that uses static HTML files to serve content. I know MovableType used to manage their blog engiene this way, but using Perl CGI scripts. How do I edit/append to HTML files preferebly using PHP? What other methods would people reccommend?

+2  A: 

Depending on how much work you want to do you could just use fopen and friends.

docgnome
+2  A: 

If you want to just edit the files as raw text:

http://us.php.net/manual/en/ref.filesystem.php

If you want to work with actual HTML DOM:

http://us.php.net/manual/en/book.dom.php

(and specifically, loadHTMLFile() and saveHTMLFile())

Amber
+1  A: 

In php there are many file manipulation functions. Read more about them here. Here's a quick example creating an html file:

<?php

file_put_contents('an_html_file.html', "This will be in the html file.");

?>
camomileCase