php 总结(2) 接受数据

<?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>

  

  

猜你喜欢

转载自www.cnblogs.com/nice2018/p/10287162.html