最短的PHP微博程序。基本需求是:1.无乱码(最好UTF-8)。 2.有输入框可以发布新信息。3.提交后马上可以看到新发的内容。4.必须使用POST方式提交。5.信息后面要有时间标记。6.不能发布任何HTML标签。
<?php
header("content-type:text/html; charset=utf-8");
$a=
@file_get_contents(l);
($p=$_POST[s])&&file_put_contents(l,$a='<hr>'.htmlspecialchars($p).date(' Y-m-d H:i').$a);
echo '<form method=post><input name=s></form>'.$a;
?>