php制作文本式留言板,php文本留言板
代码很简单,就不多废话了,直接奉上代码:
del.php
代码如下:
<?php include("menu.php"); ?>
删除留言
<?php
$id=$_GET["id"];
$info=file_get_contents("liuyan.txt");
$lylist=explode("@@@", $info);
unset($lylist[$id]);
$ninfo=implode("@@@", $lylist);
file_put_contents("liuyan.txt", $ninfo);
$alert="alert('删除成功!')";
echo "";
?>
doAdd.php
代码如下:
<?php include("menu.php"); ?>
添加留言
<?php
//获取留言板的信息
$title=$_POST["title"];
$author=$_POST["author"];
$content=$_POST["content"];
$time=time();
$ip=$_SERVER["REMOTE_ADDR"];
$ly="{$title}##{$author}##{$content}##{$time}##{$ip}@@@";
echo $ly;
$ly=$ly.file_get_contents("liuyan.txt");
file_put_contents("liuyan.txt",$ly);
$alert="alert('留言成功!谢谢!')";
echo ";"
?>
index.php
代码如下:
<?php include("menu.php"); ?>
添加留言
liuyan.txt
代码如下:
安神######1426588557##127.0.0.1@@@
show.php
代码如下:
<?php include("menu.php"); ?>
添加留言
| 留言标题 | 留言人 | 留言内容 | 留言时间 | IP地址 | 操作 |
|---|---|---|---|---|---|
| $ly[0] | ";$ly[1] | ";$ly[2] | ";".date("Y-m-d H:i:s",$ly[3]+8*3600)." | ";$ly[4] | ";删除 | ";
menu.php
代码如下:
我的留言板
添加留言
查看留言
以上所述就是本文的全部内容了,希望大家能够喜欢。
http://www.bkjia.com/PHPjc/969493.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/969493.htmlTechArticlephp制作文本式留言板,php文本留言板 代码很简单,就不多废话了,直接奉上代码: del.php 代码如下:html head meta charset="utf-8" titl...