Home > Backend Development > PHP Tutorial > PHP文件操作实现简单留言板

PHP文件操作实现简单留言板

WBOY
Release: 2016-06-20 12:49:28
Original
1344 people have browsed it

//

<?phpdate_default_timezone_set("PRC");$str="<span style='color:red;font-size:30px'>".$_GET['mname']."</span>";$time=date("Y-m-d H:i:s");$str=$time."  ".$str."<hr/>";file_put_contents("test.txt", $str,FILE_APPEND);?><!DOCTYPE html><html><head><title>留言板</title></head><body><h2>文件留言板</h2><hr/><form action="index.php">   <h3>请留言</h3>   <textarea name="mname" cols="100" rows="10"></textarea>   <br>   <input type="submit" value="提交" /></form><h2>留言查看</h2><?phpreadfile("test.txt");?></form></body></html>
Copy after login


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template