Re: please help with this simple problem
| From: | adam | Date: | Thu, 22 Mar 2001 12:36:20 +0000 |
| Subject: | Re: please help with this simple problem | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45107@lists.php.net to get a copy of this message | ||
it works now, only it's earasing everything and then writing to the file.
i think we have almost got this figured out. here's what the code looks like
for the entire tag...
-----------------------------------
<?
if ($message)
{
/* uncomment the next two lines to strip out html from input */
$name = strip_tags($name);
/* $message = strip_tags($message); */
$message = ereg_replace("\r\n\r\n", "\n<P>", $message);
$date = date("l, F j Y, h:i a");
$message = "<font size=2 face=verdana><b><a href=mailto:$email>$name</a>
</b><font size=1> -- $date</font>\n
<blockquote>\n
$message\n
</blockquote></font>\n<hr noshade color=white size=1 width=100%>\n";
$fname = basename($PHP_SELF) . ".comment";
$fsize = filesize($fname);
$fp = fopen(basename($fname),"w+");
$data = fread($fp,$fsize);
fwrite($fp,$message);
fwrite($fp,$data);
fclose($fp);
}
@readfile(basename(($PHP_SELF . ".comment")));
?>
--------------------