棋子 发表于 2007-7-16 01:32:15

PHP 写入 文本数据库 / Add text to text file

<form action="<? $PHP_SELF ?>" method="post">
<br><input type="text" name="name" value="Name"><br>
<textarea type="text" name="comm">
Add Your Comment
</textarea><br>
<input type="submit" value="Add">
<?

//ALL You need is to create comment.txt file, and give CHMOD 777

$date = date("d.m.Y");
if (!isset ($comm) && ($name)){
    $fp = fopen("comment.txt","a+");
    fwrite($fp,nl2br("<meta http-equiv=Content-Language content=hr><table border=1 width=276 height=16><td width=128 height=4>Name:$name</td><td width=132 height=4>Date:$date</td><tr><td width=266 height=9 colspan=2>$comm</td></tr></table><br>"));
    fclose($fp);
}
?>
Messages:
<?
readfile ("comment.txt");
?>

hanvord 发表于 2008-10-27 08:00:02

sean0407 发表于 2008-12-9 16:19:25

這個!該不會是.............

709 发表于 2009-1-23 08:00:06

hkbnp 发表于 2009-1-23 16:26:30

什么内容呢,看看
页: [1]
查看完整版本: PHP 写入 文本数据库 / Add text to text file