This is a module that can be placed on any php3 page to allow users to add
their comments. The comments are stored in a file in the current directory,
whose name is constructed by adding ".comment" to the calling page's name,
and merged into the calling page dynamically. (The calling page is not
I wrote this because I wanted a simple way to add this functionality to my
pages without requiring that mySQL be available.
In the message input, blank lines are converted to paragraph tags. No other
conversions are applied. If you don't want your users to be able to input
html, uncomment the "strip_tags" line.
Note that the directory must be writable by the web server.
Put this module in some convenient location and then embed it in your pages
or, relative to the docroot:
require($DOCUMENT_ROOT . "/relativepath/php3");
/* uncomment the next two lines to strip out html from input */
$message = ereg_replace("\r\n\r\n", "\n
$date = date("l, F j Y, h:i a");
$message = "$name -- $date
$fp = fopen (basename($PHP_SELF) . ".comment", "a");
fwrite ($fp, $message);
@readfile(basename(($PHP_SELF . ".comment")));
01 06 - 11 01 06
01 06 - 30 01 06