<html>
<head></head>
<body>
<form name="form 1" method="post" action="">
<table>
<tr>
<td>留言板</td>
<td><textarea name="LY" rows=8 cols=20></textarea></td>
</tr>
<tr>
<td><input type="submit" name="b1" value="显示"></td>
<td><input type="submit" name="b2" value="提交"></td>
</tr>
</table>
</form>
</body>
</html>
<?php
$str=@$_POST["LY"];
$handle=fopen("E:\PHP2\phpnow\htdocs\1.txt","w+");
file_put_contents("E:\PHP2\phpnow\htdocs\1.txt",$str);
$filename="E:\PHP2\phpnow\htdocs\1.txt";
$num=readfile($filename);
fclose($handle);
?>
我觉得应该是锁的问题。在用fileput的时候,不需要打开文件了。