<?php $fh = fopen('./msg.txt', 'a'); $str = $_POST['title'].",".$_POST['content']."\n"; fwrite($fh, $str); fclose($fh); echo "ok"; ?>
<form action="ces.php" method="post"> <p> 留言标题: <input type="text" name="title"></p> <p> 留言内容: <textarea name="content" id="" cols="30" rows="10"></textarea></p> <p><input type="submit" value="提交"></p> </form>