,,,
,
");
if (get_magic_quotes_gpc()) {
$message = stripslashes($message);
$name = stripslashes($name);
}
# deals with the name part of the form
if (strlen($name) == 0) {
$name = "anonymous";
}
#mails the comment to you
$date = date("[M j, H:i]");
mail("youraddress@yourisp.com","Comment on post $comment","$name <$url>, wrote the following on $date: $message",
"From: $email\r\n");
# deals with email part of the form - replace text with image tag if you wish
if ($email && strlen($email) > 5 && stristr($email, "@")) {
$message = "email $message";
}
# deals with url part of the form - replace text with image tag if you wish
if (strlen($url) > 7) {
if (substr($url, 0, 7) != "http://")
$url = "http://$url";
$message = "www $message";
}
# formats the message in HTML, adds date
$message = ereg_replace("\r\n\r\n", "\n", $message);
$message = "
$date $name $message
";
# writes the message to a file in the comments directory
$path= $dir."/comments/" . $comment . ".comment";
$fp = fopen ("$path", "a");
fwrite ($fp, $message . "\n");
fclose ($fp);
}
# reads the comment file
@readfile(("$dir/comments/" .$comment. ".comment"));
?>