Back to Journal Entry

*/ function make_clickable($text) // thanks to phpwizard.net { $ret = eregi_replace("([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])", "\\1://\\2\\3", $text); $ret = eregi_replace("(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))", "\\1", $ret); return($ret); } if ($message) { $name = strip_tags($name); $message = strip_tags($message); $message = ereg_replace("\r\n\r\n", "\n

", $message); $message = make_clickable($message); if (get_magic_quotes_gpc()) { $message = stripslashes($message); $name = stripslashes($name); } $date = date("l, F j Y, h:i a"); $message = "$name -- $date

$message


\r\n"; // first read the file into a buffer, if it exists $textfile = basename($PHP_SELF) . ".comment"; if ($fp = @fopen ($textfile, "r")) // open without complaining { $oldmessages = @fread($fp,filesize($textfile)); @fclose(fp); } // now reopen the file in write mode, with the // pointer at the head of the file $fp = fopen ($textfile, "w"); fwrite ($fp, $message); fwrite ($fp, $oldmessages); // adding back the old messages fclose ($fp); } @readfile(basename(($PHP_SELF . ".comment"))); ?>
Your name:

Your comment: