-
2021-11-02 09:41:47
文章目录
1.展示。
2.数据库结构。
数据库名称为liuyan,表名为liuyan,表中结构如下所示:
可以使用以下sql语句,在命令行中快速创建数据库和数据表:CREATE DATABASE liuyan; USE liuyan; CREATE TABLE IF NOT EXISTS `liuyan` ( `id` int(5) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL, `text` tinytext NOT NULL, `time` datetime NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
3.代码。
2.1 conn.php
<?php // 连接数据库 $servername="localhost"; $username="root"; $password="root"; $dbname="liuyan"; // 创建链接 $conn = new mysqli($servername,$username,$password,$dbname); // 检测链接 if($conn->connect_error){ die("连接失败:".$conn->connect_error); } ?>
这是数据库连接代码,如果数据库连接失败会打印出失败原因。
2.2 config.php
<?php //链接数据库 require_once 'conn.php'; //全站标题 $title = "我的留言板";
这是配置文件,包含了一次数据库连接文件,设定的全站title。
2.3 index.php
<?php require_once 'config.php'; ?> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title><?php echo $title; ?></title> </head> <body> <h1><a href="./index.php"><?php echo $title; ?></a></h1> <h2>写留言</h2> <form action="add.php" method="GET"> <textarea name="t" cols="30" rows="10" placeholder="说点什么..."></textarea> <p><input name="n" type="text" placeholder="你的名字"></p> <p><input type="submit" value="发表"></p> </form> <hr> <h2>留言列表</h2> <ul> <?php // 最新留言展示前面 $sql = "SELECT * FROM `liuyan` ORDER BY `liuyan`.`id` DESC"; // ORDER BY `liuyan`.`id` DESC 加上这个是降序排列 $result = $conn->query($sql); if($result->num_rows>0 ){ //输出数据 while($row = $result->fetch_assoc()){ // $result->fetch_assoc()执行一次显示第一条,执行第二次显示第二条 ?> <li> <p><?php echo $row["id"];?>楼</p> <p>留言内容:<?php echo $row["text"];?></p> <p>留言人:<?php echo $row["username"];?></p> <p>留言时间:<?php echo $row["time"];?></p> <p> <a href="edit.php?id=<?php echo $row['id'];?>">编辑</a> <a href="del.php?id=<?php echo $row['id'];?>">删除</a> </p> </li> <?php } } else { echo"暂无留言!"; } ?> </ul> </body> </html>
这是首页文件,包含了一次配置文件,主要实现了留言板的前端显示。在html代码中插入了PHP,实现了数据库查询,使用了 ORDER BY liuyan.id DESC 实现了对查询数据的降序排列,并将查询结果赋值到result变量。在通过if($result->num_rows>0)判断查询结果的行数是否大于0,如果大于0,执行while循环,打印出查询结果。否则,打印“暂无留言!”
2.4 add.php
<?php require_once 'config.php'; $t = $_GET["t"]; $n = $_GET["n"]; $time = date("Y-m-d H:i:s",time()); //插入语句 $sql = "INSERT INTO `liuyan` (`id`, `username`, `text`, `time`) VALUES (NULL, '$n', '$t', '$time');"; $conn->query($sql); header("Location:index.php"); ?>
这是添加留言文件,包含一次配置文件,通过$_get方法搜集URL:http://127.0.0.1/bbs/add.php?t=1&n=1中,t和n的值,及用户名和留言内容,再将其赋值到插入语句中。
2.5 edit.php
<?php //加载配置文件 require_once "config.php"; //GET方法接受传过来的id $id = $_GET['id']; //根据id查到当前的具体信息 $sql = "SELECT * FROM `liuyan` WHERE `id` = $id"; //执行sql的查询语句,结果赋值给result $result = $conn->query($sql); //得到当前id的留言内容 if ($result->num_rows > 0) { $res = $result->fetch_assoc(); $text = $res["text"]; } else { die("无此条留言"); } ?> <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>留言信息编辑</title> </head> <body> <h1><?php echo $title; ?></h1> <h2>编辑<?php echo $id;?>楼的留言内容</h2> <form action="updata.php" method="GET"> <input hidden name="i" value="<?php echo $res['id'] ?>" type="text"> <textarea name="t" cols="30" rows="10"><?php echo $res["text"] ?></textarea> <input type="submit" value="更新留言信息"> </form> </body> </html>
这是修改页面,实现了修改页面的前端显示。逻辑是通过$_GET方法,获取当前的id值,再通过查询语句将查询结果打印输出。
2.6 updata.php
<?php require_once "config.php"; //点击之后传了个id过来 //这边php文件通过GET接受传过来的id和2个值 $id = $_GET['i']; $t = $_GET['t']; var_dump($id); var_dump($t); //sql的更新代码 $sql = "UPDATE `liuyan` SET `text` = '$t' WHERE `liuyan`.`id` = $id;"; //执行sql更新语句 $conn->query($sql); //回到首页 header("Location:index.php"); ?>
这是编辑更新数据文件,包含一次配置文件,通过$_GET获取id值和text值,通过执行更新语句,对数据表中内容进行更新,最后通过header(“Location:index.php”);返回首页。
2.7 del.php
<?php //加载配置文件 require_once "config.php"; //点击之后传了个id过来 //这边php文件通过GET接受传过来的id $id = $_GET['id']; //删除语句 $sql = "DELETE FROM `liuyan` WHERE `liuyan`.`id` = $id"; //执行sql语句 $conn->query($sql); //$conn->query($sql1); //返回到index.php header("Location:index.php");
这是删除留言文件,通过获取id值,通过id值,执行条件删除语句。删除完成后跳转回首页。
更多相关内容 -
php 留言板
2017-12-06 15:17:26h5 mysql php留言板 适合初学者 登录页面 增加页面 删除页面 修改页面 -
PHP留言板源码含数据库文件MySQL
2020-12-25 22:09:16PHP留言板源码含数据库文件MySQL -
随缘网络PHP留言板(带审核功能) v1.0 build 091017.rar
2019-07-07 22:03:51经过一些时间的努力,随缘网络PHP留言板V1.0(带审核功能)总算正式发布了,该留言系统采用PHP MYSQL编写,界面色调风格延续之前asp版留言系统简洁浅蓝色风格,稍有所变动。希望大家能够喜欢。初发布,系统中难免有些... -
简单实现PHP留言板功能
2021-01-20 00:59:53本文实例为大家分享了PHP留言板功能的具体实现代码,供大家参考,具体内容如下 HTML代码 <div class=head xss=removed><h2 xss=removed>PHP留言本</h2></div> <div class=pan -
XYCMS留言板PHP版 v1.9
2020-10-02 17:34:41XYCMS留言板是以php+MySQL进行开发的php留言板源码,软件为普通的留言板可广泛应用于企业网站等需要留言板的网站中进行使用。 安装路径:/install 后台路径:/system/ 后台默认用户名,密 -
php实现留言板功能(代码详解)
2020-12-20 02:43:56简单的PHP留言板制作 做基础的留言板功能 需要三张表: 员工表,留言表,好友表 首先造一个登入页面: <form action="drcl.php" method="post"> 帐号:<input type="text" name="zhang"/> 口令:&... -
php留言板源码系统
2013-11-04 14:45:39php源码,留言板源码,php留言板,留言板源码,适合初学者 -
php实现留言板功能
2020-10-20 06:52:12本文主要介绍了php实现留言板功能的实例,具有很好的参考价值。下面跟着小编一起来看下吧 -
PHP留言板源码
2017-02-20 14:08:01用PHP写的留言板 -
php留言板
2019-04-18 01:31:18NULL 博文链接:https://lkj582059.iteye.com/blog/1845646 -
php简单的留言板与回复功能具体实现
2020-10-26 06:21:47留言板是在刚接触php时用来学习的一个简单的应用例子了,今天我再给初学php的朋友提供一个完整的php留言板的全部制作过程,希望对你会有帮助 -
webstar PHP留言板 V3.2
2021-05-17 05:21:27摘要:PHP源码,聊天留言,webstar,PHP留言板 webstar留言板,一个比较简单的php留言板,内部设有一个“个人空间”,以便给用户查看管理自己的个人留言等信息.。 留言板不是太复杂,所以除了“个人空间”外,就... -
一个可分页的基于文本的PHP留言板源码第1/2页
2020-12-17 17:14:44小弟初学PHP,编了一个留言板程序,自我感觉良好,故厚着脸皮放了上来,请各位大哥指正。源程序如下: <?php //文件名:guest.php //设定部分 $guestfile=”guest”;//纪录留言的文本文件 $home=”index.... -
PHP实现留言板功能的详细代码
2020-10-20 03:09:07主要为大家详细介绍了PHP实现留言板功能的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 -
php开源多功能留言板网站源码V1.2
2022-05-01 22:23:56php开源多功能留言板网站源码V1.2 软件特点: 1、SpeedPHP框架驱动,高效轻快。 2、可创建多个留言板;每个留言板都能设置不同的模板;每个留言板都能设置单独管理员; 3、内置两套模板一个默认模板一个响应式模板... -
使用PHP连接数据库实现留言板功能的实例讲解(推荐)
2020-10-19 06:07:48下面小编就为大家带来一篇使用PHP连接数据库实现留言板功能的实例讲解(推荐)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧 -
PHP留言板的制作
2021-12-07 19:39:58作为一个PHP的初学者,我就试着写了一个留言板,用来加深自己对PHP语句和mysql语句 的运用和理解。 首先我们先来介绍什么是留言板,留言板就是我们所发表意见的载体,用来承载和展示我们对某些事物的看法和意见...php+mysql制作留言版
作为一个PHP的初学者,我就试着写了一个留言板,用来加深自己对PHP语句和mysql语句
的运用和理解。
首先我们先来介绍什么是留言板,留言板就是我们所发表意见的载体,用来承载和展示我们对某些事物的看法和意见。
首先我们再写留言板前需要创建一个数据库和两个数据表(或三个数据表都可以,这里我选择的是建立两个数据表)
info数据库:
建立好数据库后创建两个表:
第一个member表(用来管理账号):
第二个speak表(用来管理留言的):
#一:现在我们需要写一个注册页面:
#member.php(这是注册的前端代码) 代码如下:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>会员管理系统</title> <style> .main{width= 80%;margin: 0 auto;text-align:center} /* margin设置一个元素所有外边距的宽度,或者设置各边上外边距的宽度 若使用auto浏览器计算外边距*/ /* .main ul{width: 90%;margin: 0 auto;text-align: center} */ .current{color: darkgreen} /* font-size:16px作用设置设置字体的尺寸 */ /* */ h2{text-align: center;font-size:20px;} h2 a:hover{ color: aqua;text-decoration:underline}/* 在这个hover中的color主要是设置鼠标放在标题上的颜色 text-decoration 主要是设置鼠标放在标题上出现下划线*/ h2 a:last-child{margin-right:0px}/* a:last-childa标签中最后一个子元素 */ h2 a{margin-right: 15px;color: navy;text-decoration: none}/* margin-right设置a标签右边的距离 */ .color{color:#FF3333} body { background:url('./127.jpeg') no-repeat center top; background-size:cover; /* background="./127.jpg" background-size:cover; */ } </style> </head> <body > <div class="main"> <h1>留言板</h1> <h2> <a href="member.php" class="current">1:注册 </a> <a href="login.php" >2:登陆 </a> </h2> <form action="member1.php" method="post" onsubmit="return check()"> <table align="center" border="1" font-size:16px; style="border-collapse: collapse" cellpadding="10" cellspacing="0"><!-- border作用是增加一个边框 --> <tr> <td align="right">用户名:</td> <td align="left"><input type="text" name="username" onblur="checkUsername()" value="请输入用户名"><span class="color">*</span></td> <!--onblur="checkUsername()"的作用是连接javascript 即当用户离开输入字段时执行 JavaScript--> </tr> <tr> <td align="right">密码:</td> <td align="left"><input type="password" name="code" ><span class="color">*</span></td> </tr> <tr> <td align="right">性别:</td> <td> <input type="radio" checked="checked" name="sex" id="1" value="1"><label for="1">男</label> <input type="radio" name ="sex" id="2" value="0"><label for="2">女</label> </td> </tr> <tr> <td align="right">爱好</td> <td align="left"> <input type="checkbox" name="fav[]" id="t"value="听音乐"><label for="t">听音乐</label> <input type="checkbox" name="fav[]" id="wt" value="看电音"><label for="wt">看电影</label> <input type="checkbox" name="fav[]" checked="checked" id="日落" value="看日落"><label for="日落">看日落</label> </tr> <tr> <td align="right"><input type="submit" value="提交"></td> <td><input type="reset" value="重置"></td> </tr> </table> </form> </div> <script> function check() { let username = document.getElementsByName('username')[0].value.trim(); let code = document.getElementsByName('code')[0].value.trim(); //用户名验证 let usernameReg = /^[a-zA-Z0-9]{6,20}$/; if(!usernameReg.test(username))//js中test() 方法用于检测一个字符串是否匹配某个模式 { alert('用户名必填,且只能由大小写字符和数字构成,长度为6到20个字符!'); return false; } let pwreg = /^[a-zA-Z0-9_*]{6,20}$/; if(!pwreg.test(code)) { alert('密码必填,且只能由大小写字符和数字构成,长度为6到20个字符!'); return false; } return true; } </script> </body> </html>
#member1.php(这是注册页面的后端)代码如下:
<?php header("Content-Type:text/html;charset=utf-8"); $username=trim($_POST['username']); $code=trim($_POST['code']); $sex=trim($_POST['sex']); $fav=@implode(",",$_POST['fav']);//inplode做用是用逗号把爱好个数组连接起来即把数组元素组合为字符串: // 连接数据库; // 1:连接数据库服务器; //2:设置字符集。 if(!strlen($username) || !strlen($code) )//判断字符串长度 { echo "<script>alert('用户名和密码必须全部填写');history.back();</script>"; exit; } if(!preg_match('/^[a-zA-Z0-9]{6,20}$/',$username))//preg_match 函数用于执行一个正则表达式匹配。即判断$username是否满足正则表达式规则 { echo "<script>alert('用户名必填,且只能大小写字符和数字构成,长度为6到20个字符!')history.back()</script>"; exit; } if(!preg_match('/^[a-zA-Z0-9]{6,20}$/',$code)) { echo "<script>alert('密码必填,且只能大小写字符和数字组成,长度为6到20个字符');history.back();</script>"; exit; } include_once "conn.php"; $sql="select * from member where username='$username'"; $result=mysqli_query($conn,$sql);//返回一个字符集 执行针对数据库的查询 query 必需,规定查询字符串。 $num=mysqli_num_rows($result);//mysqli_num_rows()函数返回结果集中行的数量 if($num) { echo "<script>alert('输入的用户名已经存在,请重新输入。'); history.back();</script>"; exit; } $sql="insert into member(username,code,sex,fav,createtime) value('$username','".md5($code)."','$sex','$fav','".time()."')"; $result=mysqli_query($conn,$sql); if($result) { echo "<script>alert('注册成功,请登陆用户');location.href='login.php';</script>"; // location.href='login.php'作用是注册成功跳转到login.php页面。 } else { echo "<script>alert('注册失败,请重新注册。');history.back();</script>"; // history.back()的作用是注册失败重新返回注册页面 }
展示图:
(这是注册页面的后端)代码如下:
#二:是我们的登陆页面:
登陆前端代码login.php 代码如下:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>留言板</title> <style> .main{width= 80%;margin: 0 auto;text-align:center} .current{color:darkgreen} h2{text-align:center;font-size:20px;} h2 a{margin-right: 15px; color:navy ;text-decoration: none} h2 a:hover{color:aqua;text-decoration:underline} h2 a:last-child{margin-right:0px} body { background:url('./5.jpg') no-repeat center top; /* 一般的链接指向代码。 no-repeat作用是不铺平页面即不会随着页面的改变而铺平整个页面*/ background-size:cover;/* background-size规定背景图片的尺寸。 */ /* background="./127.jpg" background-size:cover; */ /* */ } </style> </head> <body > <div class="main"> <h1>留言板</h1> <h2> <!-- <a href="index.php" >1:首页 </a> --> <a href="member.php" >1:注册 </a> <a href="login.php" class="current">2:登陆 </a> <!-- <a href="revise.php" >4:个人资料修改 </a> --> <!-- <a href="admin.php" >5:后台管理</a></br> --> </h2> <form action="Login1.php" method="post" onsubmit="return check()"> <table border="1" align="center" cellpadding="10" cellspacing="0" font-size:16px; style="border-collapse: collapse" > <!-- <table style="width: 30%;height:200px;margin: 0 auto;margin-top:15%;background:#E0FFFF60;border-radius:20px"> --> <tr> <td align="right">用户名:</td> <td align="left"><input type="text" name="username" placeholder="请输入用户名" onblur="checkUsername()"></td> </tr> <tr> <td align="right">密码:</td> <td align="left"><input type="password" name="code"></td> </tr> <tr> <td colspan="2"> <input type="submit" value="登录"> </td> </tr> </table> </form> </div> <script> function check() { let username = document.getElementsByName('username')[0].value.trim(); let code = document.getElementsByName('code')[0].value.trim(); let usernameReg = /^[a-zA-Z0-9]{6,20}$/; if(!usernameReg.test(username)) { alert('用户名必填,且只能大小写字符和数字构成,长度为6到20个字符!'); return false; } let pwreg=/^[a-zA-Z0-9]{6,20}$/; if(!pwreg.test(code)) { alert('密码必填,且只能大小写字符和数字组成,长度为6到20个字符'); return false; } return true; } </script> </body> </html>
登陆后端代码Lojin1.php 代码如下:
<?php session_start(); $username = trim($_POST['username']); $code = trim($_POST['code']); if(!strlen($username) || !strlen($code)) { echo "<script>alert('用户名和密码必须全部填写');history.back();</script>"; exit; } if(!preg_match('/^[a-zA-Z0-9]{6,20}$/',$username)) { echo "<script>alert('用户名必填,且只能大小写字符和数字构成,长度为6到20个字符!');history.back();</script>"; exit; } if(!preg_match('/^[a-zA-Z0-9]{6,20}$/',$code)) { echo "<script>alert('密码必填,且只能大小写字符和数字组成,长度为6到20个字符');history.back()</script>"; exit; } include_once "conn.php"; $sql="select * from member where username='$username'and code='".md5($code)."'"; $result=mysqli_query($conn,$sql);//返回一个字符集 $num=mysqli_num_rows($result); if($num) { $info=mysqli_fetch_array($result); if($info['admin']) { $_SESSION['isadmin']=1; } else { $_SESSION['isadmin']=0; } $_SESSION['loggedUsername']=$username; echo "<script>alert('登陆成功');location.href = 'index0.php';</script>"; } else { unset($_SESSION['loggedUsername']);//unset() 函数用于销毁给定的变量。 echo "<script>alert('登陆失败');history.back();</script>"; }
展示图:
#三这是我们的个人资料修改代码:
个人资料修改前端代码 revise.php 代码如下:
<?php session_start(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>会员管理系统</title> <style> .main{width= 80%;margin: 0 auto;text-align:center} /* .main ul{width: 90%;margin: 0 auto;text-align: center} */ .current{color: darkgreen} /* font-size:16px作用设置设置字体的尺寸 */ /* */ h2{text-align: center;font-size:20px;} h2 a:hover{ color: aqua;text-decoration:underline}/* 在这个hover中的color主要是设置鼠标放在标题上的颜色 text-decoration 主要是设置鼠标放在标题上出现下划线*/ h2 a:last-child{margin-right:0px}/* a:last-childa标签中最后一个子元素 */ h2 a{margin-right: 15px;color: navy;text-decoration: none}/* margin-right设置a标签右边的距离 */ body { background:url('./5.jpg') no-repeat center top; background-size:cover; /* background="./127.jpg" background-size:cover; */ } </style> </head> <body > <div class="main"> <h1>留言板</h1> <h2> <a href="index0.php" >1:首页 </a> <!-- <a href="member.php" >2:注册 </a> --> <!-- <a href="login.php" >3:登陆 </a> --> <a href="revise.php" class="current">4:个人资料修改 </a> <a href="admin.php" >5:后台管理</a></br> </h2> <?php include_once "conn.php"; $sql="select *from member where username='".$_SESSION['loggedUsername']."'"; $result=mysqli_query($conn,$sql); $num=mysqli_num_rows($result); if( $num) { $info=mysqli_fetch_array($result); $fav = explode(",",$info['fav']); // echo "$fav"; } else { die('未找到有效用户'); } ?> <form action="revise1.php" method="post" onsubmit="return check()"> <table align="center" border="1" font-size:16px; style="border-collapse: collapse" cellpadding="10" cellspacing="0"><!-- border作用是增加一个边框 --> <tr> <td align="right">用户名:</td> <td align="left"> <input type="text" name="username" onblur="checkUsername()" value="<?php echo $info['username'] ?>" readonly > </td> <!--onblur="checkUsername()"的作用是连接javascript 即当用户离开输入字段时执行 JavaScript--> <!-- readonly的作用是定义用户名为只读 --> </tr> <tr> <td align="right">密码:</td> <td align="left"><input type="password" name="code" placeholder="不修改密码请留空" ></td> </tr> <tr> <td align="right">性别:</td> <td> <input type="radio" name="sex" id="1" value="1" <?php if($info['sex']){echo "checked";}?>><label for="1">男</label> <input type="radio" name ="sex" id="2" value="0" <?php if(!$info['sex']){echo "checked";}?>><label for="2">女</label> </td> </tr> <tr> <td align="right">爱好</td> <td align="left"> <input type="checkbox" name="fav[]" id="t"value="听音乐" <?php if(in_array('听音乐',$fav)){echo "checked";}?>><label for="t">听音乐</label> <input type="checkbox" name="fav[]" id="wt" value="看电影" <?php if(in_array('看电影',$fav)){echo "checked";}?>><label for="wt">看电影</label> <input type="checkbox" name="fav[]" checked="checked" id="日落" value="看日落" <?php if(in_array('看日落',$fav)){echo "checked";}?>><label for="日落">看日落</label> </tr> <tr> <td align="right"><input type="submit" value="提交"></td> <td><input type="reset" value="重置"></td> </tr> </table> </form> </div> <script> function check() { let code = document.getElementsByName('code')[0].value.trim(); //用户名验证 let pwreg = /^[a-zA-Z0-9_*]{6,20}$/; if(code.length > 0) { if(!pwreg.test(code)) { alert('密码只能由大小写字符和数字构成,长度为6到20个字符!'); return false; } } return true; } </script> </body> </html>
个人资料修改后端代码revise1.php 代码如下:
<?php header("Content-Type:text/html;charset=utf-8"); $username=$_POST['username']; $code=$_POST['code']; $sex=$_POST['sex']; $fav=@implode(",",$_POST['fav']); if(!strlen($username)) { echo "<script>alert('用户名必须填写');history.back();</script>"; exit; } if(!empty($code)) //empty() 函数用于检查一个变量是否为空。 //empty() 判断一个变量是否被认为是空的。当一个变量并不存在,或者它的值等同于 FALSE,那么它会被认为不存在。如果变量不存在的话,empty()并不会产生警告。 { if(preg_match('/^[a-zA-Z0-9]{6,20}$/',$code)) { echo "<script<alert('密码只能由大小写字符和数字组成,长度为6到20个字符');history.back();</script>"; exit; } } include_once 'conn.php'; if($code) { $sql="update member set code='".md5($code)."' sex=$sex ,fav='$fav' where username='$username'"; } else { $sql="update member set sex=$sex, fav='$fav' where username='$username'"; } $result=mysqli_query($conn,$sql); if($result) { echo "<script>alert('资料改写成功');location.href='index0.php';</script>"; exit; } else { echo "<script>alert('资料改写失败,请重写改写据。');history.back();</script>"; exit; }
展示图:
#后台管理前端代码admin.php 代码如下:
<?php session_start(); if(!isset($_SESSION['isadmin']) || !$_SESSION['isadmin']) { echo "<script>alert('请以管理员的的身份登录后,在进入后台。');location.href='index0.php';</script>"; exit; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>留言板</title> <style> .main{width= 80%;margin: 0 auto;text-align:center} .current{color:darkgreen} h2{text-align:center;font-size:20px;} h2 a{margin-right: 15px; color:navy ;text-decoration: none} h2 a:hover{color:aqua;text-decoration:underline} h2 a:last-child{margin-right:0px} tr:hover{background-color:azure} body { background:url('./5.jpg') no-repeat center top; background-size:cover; /* background="./127.jpg" background-size:cover; */ } </style> </head> <body > <div class="main"> <h1>留言板</h1> <?php if(isset($_SESSION['loggedUsername']) && $_SESSION['loggedUsername'] <> ''){ ?> <div class="logged">当前登录者:<?php echo $_SESSION['loggedUsername'];?> <?php if($_SESSION['isadmin']) {?><span style="color: crimson">欢迎管理员登录 </span><?php }?><span class="logout"><a href="logout.php">注销登录</a></span> </div> <?php } ?> <h2> <a href="index0.php" >1:首页 </a> <a href='留言管理.php'>2:留言管理</a> <!-- <a href="member.php" >2:注册 </a> --> <!-- <a href="login.php" >3:登陆 </a> --> <!-- <a href="revise.php" >4:个人资料修改 </a> --> <a href="admin.php" class="current">3:后台管理</a></br> </h2> <?php include_once 'conn.php'; $sql="select * from member order by id desc";//order by id desc 作用是让查到的数据id按照有大到下的顺序排列。 $result=mysqli_query($conn,$sql); ?> <table align="center" border="1" width="100%" cellspacing="0" cellpadding="10" styel="border-collapase: collapse" > <tr> <td>序号</td> <td>用户名</td> <td>密码</td> <td>性别</td> <td>爱好</td> <td>是否是管理员</td> <td>操作</td> </tr> <?php $i=1; while($info=mysqli_fetch_array($result)) { ?> <tr> <td><?php echo $i;?></td> <td><?php echo $info['username'];?></td> <td><?php echo $info['code'];?></td> <td><?php echo $info['sex'] ? '男' : '女'; ?></td>` <td><?php echo $info['fav'];?></td> <td><?php echo $info['admin'] ? '是' : '否';?></td> <td> <!-- <a href='留言管理.php'>留言管理</a> --> <a href='revise+.php?username=<?php echo $info['username'];?>'>资料修改</a> <?php if($info['username'] <> 'isadmin') {?> <a href="javascript:del(<?php echo $info['id'];?>,'<?php echo $info['username'];?>')">删除用户</a><!-- javascript:del的作用是给一机会判断是否删除用户 --> <?php } else {?> <span style="color:gray">删除用户</span> <?php } ?> <?php if($info['admin']) { if($info['username'] <> 'isadmin') {?> <a href="setadmin.php?action=0&id=<?php echo $info['id'];?>">取消管理员</a> <!-- 涉及到地址传参,其中&是用来分割参数的 --> <?php } else { echo '<span style="color:gray">取消管理员</spqn>'; } ?> <?php } else {?> <a href="setadmin.php?action=1&id=<?php echo $info['id'];?>">设置管理员</a> <?php } ?> </td> </tr> <?php $i++; } ?> </table> </div> <script> function del(id,name) { if(confirm('您确定要删除 '+name+' 用户吗?')) { location.href='del.php?id='+id+'&username='+name; } } </script> </body> </html>
后台管理后端代码:
1:取消管理员代码setadmin.php 代码如下:
<?php session_start(); if(!isset($_SESSION['isadmin']) || !$_SESSION['isadmin'])//isset() 函数用于检测变量是否已设置并且非 NULL { echo "<script>alert('请以管理员的的身份登录后,在进入后台。');location.href='index0.php';</script>"; exit; } ?> <?php $action=$_GET['action']; $id=$_GET['id']; include_once 'conn.php'; if(is_numeric($action) && is_numeric($id))//判断is_numeric()函数的作用是判断括号中的内容是不是数字。 { if($action==1 || $action==0) { $sql="update member set admin='$action' where id='$id'"; } else { echo "<script>alert('参数错误');history.back();</script>"; } $result=mysqli_query($conn,$sql); if($result) { echo "<script>alert('设置或取消管理员成功');location.href='admin.php';</script>"; } else { echo "<script>alert('设置或取消管理员失败');history.back();</script>"; } } else { //id和action 其中一个或全部不是数字 echo "<script>alert('参数错误');history.back();</script>"; }
2:管理员实现用户资料修改 resive+.php 代码如下:
<?php session_start(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>会员管理系统</title> <style> .main{width= 80%;margin: 0 auto;text-align:center} /* .main ul{width: 90%;margin: 0 auto;text-align: center} */ .current{color: darkgreen} /* font-size:16px作用设置设置字体的尺寸 */ /* */ h2{text-align: center;font-size:20px;} h2 a:hover{ color: aqua;text-decoration:underline}/* 在这个hover中的color主要是设置鼠标放在标题上的颜色 text-decoration 主要是设置鼠标放在标题上出现下划线*/ h2 a:last-child{margin-right:0px}/* a:last-childa标签中最后一个子元素 */ h2 a{margin-right: 15px;color: navy;text-decoration: none}/* margin-right设置a标签右边的距离 */ </style> </head> <body> <div class="main"> <h1>留言板</h1> <h2> <a href="index.php" >1:首页 </a> <!-- <a href="member.php" >2:注册 </a> --> <!-- <a href="login.php" >3:登陆 </a> --> <a href="revise.php" class="current">4:个人资料修改 </a> <a href="admin.php" >5:后台管理</a></br> </h2> <?php include_once "conn.php"; $username=$_GET['username']; $sql="select *from member where username='$username'"; $result=mysqli_query($conn,$sql); $num=mysqli_num_rows($result); if( $num) { $info=mysqli_fetch_array($result); $fav = explode(",",$info['fav']); // echo "$fav"; } else { die('未找到有效用户'); } ?> <form action="revise1.php" method="post" onsubmit="return check()"> <table align="center" border="1" font-size:16px; style="border-collapse: collapse" cellpadding="10" cellspacing="0"><!-- border作用是增加一个边框 --> <tr> <td align="right">用户名:</td> <td align="left"> <input type="text" name="username" onblur="checkUsername()" value="<?php echo $info['username'] ?>" > </td> <!--onblur="checkUsername()"的作用是连接javascript 即当用户离开输入字段时执行 JavaScript--> <!-- readonly的作用是定义用户名为只读 --> </tr> <tr> <td align="right">密码:</td> <td align="left"><input type="password" name="code" placeholder="不修改密码请留空" ></td> </tr> <tr> <td align="right">性别:</td> <td> <input type="radio" name="sex" id="1" value="1" <?php if($info['sex']){echo "checked";}?>><label for="1">男</label> <input type="radio" name ="sex" id="2" value="0" <?php if(!$info['sex']){echo "checked";}?>><label for="2">女</label> </td> </tr> <tr> <td align="right">爱好</td> <td align="left"> <input type="checkbox" name="fav[]" id="t"value="听音乐" <?php if(in_array('听音乐',$fav)){echo "checked";}?>><label for="t">听音乐</label> <input type="checkbox" name="fav[]" id="wt" value="看电影" <?php if(in_array('看电影',$fav)){echo "checked";}?>><label for="wt">看电影</label> <input type="checkbox" name="fav[]" checked="checked" id="日落" value="看日落" <?php if(in_array('看日落',$fav)){echo "checked";}?>><label for="日落">看日落</label> </tr> <tr> <td align="right"><input type="submit" value="提交"></td> <td><input type="reset" value="重置"></td> </tr> </table> </form> </div> <script> function check() { let code = document.getElementsByName('code')[0].value.trim(); //用户名验证 let pwreg = /^[a-zA-Z0-9_*]{6,20}$/; if(code.length > 0) { if(!pwreg.test(code)) { alert('密码只能由大小写字符和数字构成,长度为6到20个字符!'); return false; } } return true; } </script> </body> </html>
3:管理员删除用户del.php 代码如下:
<?php session_start(); if(!isset($_SESSION['isadmin']) || !$_SESSION['isadmin']) { echo "<script>alert('请以管理员的的身份登录后,在进入后台。');location.href='index.php';</script>"; exit; } include_once 'conn.php'; $id=$_GET['id']; $username=$_GET['username']; // echo "<script>alert('$id');</script>"; if(is_numeric($id))//is_numeric()函数用于检测变量是否为数字或数字字符串。 { $sql="delete from member where id=$id"; $result=mysqli_query($conn,$sql); if($result) { echo "<script>alert('删除用户 $username 成功!');location.href='admin.php';</script>"; } else { echo "<script>alert('删除用户 $username 失败!');history.back();</script>"; } } else { echo "<script>alert('参数错误!');history.back();</script>"; }
后端管理展示图:
#四:首页留言页面:
首页index0.php 代码如下:
<?php session_start(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>留言板</title> <style> /* *{margin:0;padding:0;} */ /* body,html{width: 100px;height: 100px;} */ .main{width= 80%;margin: 0 auto;text-align:center} .current{color:darkgreen} h2{text-align:center;font-size:20px;} h2 a{margin-right: 15px; color:navy ;text-decoration: none} h2 a:hover{color:aqua;text-decoration:underline} h2 a:last-child{margin-right:0px} .logged{font-size:15px;color:#00FFCC} .logout{margin-left:15px;margin-bottom:10px} .logged a{color:#CCCCFF;text-decoration:none} .logged a:hover{text-decoration:underline;color:aqua} body { background:url('./127.jpg') no-repeat center top; background-size:cover; /* background="./127.jpg" background-size:cover; */ } .message { width:600px; height:170px; background:#fff; background:rgba(255,255,255,0.25); margin: 100px auto 0; border: radious 5px; padding: 5px; } .message p { color:aqua; font-size:12px; line-height:25px; } .message .text { width: 600px; height:70px; border: 1px solid #ddd; background:rgba(255,255,255,0.25); } .message .btn { width:600px; height:50px; margin-top:10;/* 遇上个边框的距离为10像素 */ } .message .btn .face-btn { float:left;/*属性定义元素在哪个方向浮动。以往这个属性总应用于图像*/ } .message .btn .mes-btn { float:right; background:rgba(255,255,255,0.25);/* rgba() 函数使用红(R)、绿(G)、蓝(B)、透明度(A)的叠加来生成各式各样的颜色。其中最后一个为调节透明度 */ padding: 0px 5px;/* 设置 p 元素的 4 个内边距 其中第一个为上下边距 第二个为左右边距 */ border-radius:0px;/* 向 div 元素添加圆角边框 */ font-size:12px;/* 设置字体大小 */ cursor:pointer;/* 设置鼠标形状。 */ } .message .btn input { float:right; background:rgba(255,255,255,0.25); padding: 5px 20px; border-radius:5px; font-size:12px; cursor:pointer;/* 设置鼠标形状。 */ } </style> </head> <body> <div class="main"> <h1>留言板</h1> <?php if(isset($_SESSION['loggedUsername']) && $_SESSION['loggedUsername'] <> ''){ ?> <div class="logged">当前登录者:<?php echo $_SESSION['loggedUsername'];?> <?php if($_SESSION['isadmin']) {?><span style="color: crimson">欢迎管理员登录 </span><?php }?><span class="logout"><a href="logout.php">注销登录</a></span> </div> <?php } ?> <h2> <a href="index0.php" class="current">1:首页 </a> <a href="展示留言.php" >2:显示留言 </a> <!-- <a href="login.php" >3:登陆 </a> --> <a href="revise.php" >3:个人资料修改 </a> <a href="admin.php" >4:后台管理</a></br> </h2> </div> <form action="留言后端.php" method="post" > <div class="message"> <P>你想对iu说些什么?</p> <div class="btn"> <textarea name="speak" cols="30" rows="10" placeholder="说点什么..." class="text" onblur="checkUsername()"></textarea> <span class="mes-btn"><p align="right"><input type="submit" value="发表" ></p></span> <span class="mes-btn"><p align="left"><input name="name" type="text" placeholder="你的名字"></p></p></span> </div> </div> </form> </form> </div> </body> </html>
留言后端代码:留言后端.php(文件名称最好用英文不要用中文) 代码如下:
<?php session_start(); $username=$_SESSION['loggedUsername']; $speak=$_POST['speak']; $name=$_POST['name']; include_once 'conn.php'; if(!strlen($speak)) { echo "<script>alert('留言必须填写!(你怎能没有什么想说的)');history.back();</script>"; exit; } if(!strlen($name)) { echo "<script>alert('姓名你都不填,你想干啥!');history.back();</script>"; exit; } // echo "<script>alert('sdfsdfsd');location.href='22.php';</script>"; // echo "<script>alert('');location.href='22.php';</script>"; $sql="insert into speak(name,speak,createtime,username) value('$name','$speak','".time()."','$username')"; $result=mysqli_query($conn,$sql); if($result) { echo "<script>alert('留言成功');location.href='index0.php';</script>"; } else { echo "<script>alert('留言失败。')hisotory.back();</script>"; }
留言页面展示图:
#五:展示留言:
展示留言.php 代码如下:
<?php session_start(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>留言板</title> <style> .main{width= 80%;margin: 0 auto;text-align:center} .current{color:darkgreen} h2{text-align:center;font-size:20px;} h2 a{margin-right: 15px; color:navy ;text-decoration: none} h2 a:hover{color:aqua;text-decoration:underline} h2 a:last-child{margin-right:0px} tr:hover{background-color:azure} body { background:url('./5.jpg') no-repeat center top; background-size:cover; /* background="./127.jpg" background-size:cover; */ } </style> </head> <body > <div class="main"> <h1>留言板</h1> <h2> <a href="index0.php" >1:首页 </a> <a href="展示留言.php" class="current">2:显示留言 </a> <a href="revise.php" >3:个人资料修改 </a> <a href="admin.php" >4:后台管理</a></br> </h2> <?php include_once 'conn.php'; $sql="select * from speak order by id desc";//order by id desc 作用是让查到的数据id按照有大到下的顺序排列。 $result=mysqli_query($conn,$sql); ?> <table align="center" border="1" width="100%" cellspacing="0" cellpadding="10" styel="border-collapase: collapse" > <tr> <td>序号</td> <td>用户名</td> <td>姓名</td> <td>留言</td> <td>时间</td> <td>操作</td> </tr> <tr> <?php $i=1; while($info=mysqli_fetch_array($result)) {?> <tr> <td><?php echo $i;?></td> <td><?php echo $info['username'];?></td> <td><?php echo $info['name'];?></td> <td><?php echo $info['speak'];?></td> <td><?php echo $info['createTime'];?></td> <td> <?php if($info['username']==$_SESSION['loggedUsername']) {?> <a href="编辑留言.php?id=<?php echo $info['id'];?>">编辑留言</a> <a href="javascript:del(<?php echo $info['id'];?>,'<?php echo $info['name'];?>')">删除留言</a> <?php } else { echo '<span style="color:gray">编辑留言 </spqn>'; echo '<span style="color:gray"> 删除留言</spqn>'; } ?> </tr> <?php $i++; } ?> </tr> </table> </div> <script> function del(id,name) { if(confirm('您确定要删除 '+name+' 的留言吗?')) { location.href='删除后端.php?id='+id+'&username='+name; } } </script> </body> </html>
编辑留言.php 代码如下:
<?php session_start(); ?> <?php include_once 'conn.php'; $id=$_GET["id"]; // $sql="select * from speak where id='$id'"; // $result=mysqli_query($conn,$sql); $sql="select * from speak where id='$id'"; $result=mysqli_query($conn,$sql); $info=mysqli_fetch_array($result); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>留言板</title> <style> /* *{margin:0;padding:0;} */ /* body,html{width: 100px;height: 100px;} */ .main{width= 80%;margin: 0 auto;text-align:center} .current{color:darkgreen} h2{text-align:center;font-size:20px;} h2 a{margin-right: 15px; color:navy ;text-decoration: none} h2 a:hover{color:aqua;text-decoration:underline} h2 a:last-child{margin-right:0px} .logged{font-size:15px;color:#00FFCC} .logout{margin-left:15px;margin-bottom:10px} .logged a{color:#CCCCFF;text-decoration:none} .logged a:hover{text-decoration:underline;color:aqua} body { background:url('./127.jpg') no-repeat center top; background-size:cover; /* background="./127.jpg" background-size:cover; */ } .message { width:600px; height:170px; background:#fff; background:rgba(255,255,255,0.25); margin: 100px auto 0; border: radious 5px; padding: 5px; } .message p { color:aqua; font-size:12px; line-height:25px; } .message .text { width: 600px; height:70px; border: 1px solid #ddd; background:rgba(255,255,255,0.25); } .message .btn { width:600px; height:50px; margin-top:10;/* 遇上个边框的距离为10像素 */ } .message .btn .face-btn { float:left; } .message .btn .mes-btn { float:right; background:rgba(255,255,255,0.25); padding: 0px 5px; border-radius:0px; font-size:12px; cursor:pointer;/* 设置鼠标形状。 */ } .message .btn input { float:right; background:rgba(255,255,255,0.25); padding: 5px 20px; border-radius:5px; font-size:12px; cursor:pointer;/* 设置鼠标形状。 */ } </style> </head> <body> <div class="main"> <h1>留言板</h1> <?php if(isset($_SESSION['loggedUsername']) && $_SESSION['loggedUsername'] <> '')//isset() 函数用于检测变量是否已设置并且非 NULL { ?> <div class="logged">当前登录者:<?php echo $_SESSION['loggedUsername'];?> <?php if($_SESSION['isadmin']) {?><span style="color: crimson">欢迎管理员登录 </span><?php }?><span class="logout"><a href="logout.php">注销登录</a></span> </div> <?php } ?> <h2> <a href="index0.php" class="current">1:首页 </a> <!-- <a href="member.php" >2:注册 </a> --> <!-- <a href="login.php" >3:登陆 </a> --> <a href="revise.php" >4:个人资料修改 </a> <a href="admin.php" >5:后台管理</a></br> </h2> </div> <form action="编辑后端.php" method="post"> <div class="message"> <P>你想对iu说些什么?</p> <div class="btn"> <textarea name="speak" cols="30" rows="10" placeholder="说点什么..." class="text" id="<?php echo $info['id'];?>"><?php echo $info['speak'];?></textarea> <span class="mes-btn"><p align="right"><input type="submit" value="更新留言" ></p></span> <span class="mes-btn"><p align="left">留言人姓名:<input name="name" type="text" value="<?php echo $info['name'];?>" readonly></p></p></span> </div> </div> </form> </form> </div> </body> </html>
展示留言界面 展示图:
编辑留言后端
编辑后端.php 代码如下:
<?php $speak=$_POST['speak']; $name=$_POST['name']; $id=$_POST['id']; if(!strlen($speak)) { echo "<script>alert('留言必须填写!!!');history.back();</script>"; exit; } include_once 'conn.php'; $sql="update speak set speak='$speak' where name='$name' "; $result=mysqli_query($conn,$sql); if($result) { echo "<script>alert('更新留言成功!!!');location.href='展示留言.php';</script>"; exit; } else { echo "<script>alert('更新留言失败!!!');history.back();</script>"; exit; }
删除后端代码
删除后端.php 代码如下:
<?php session_start(); $id=$_GET['id']; $username=$_GET['username']; if(is_numeric($id))//判断传入的id是否位数字。 { include_once 'conn.php'; $sql="delete from speak where id=$id"; $result=mysqli_query($conn,$sql); if($result) { echo "<script>alert('$username 用户的留言删除成功!');location.href='展示留言.php';</script>"; } else { echo "<script>alert('$username 用户留言删除失败!');history.back();</script>"; } } else { echo "<script>alert('参数错误!');history.back();</script>"; }
管理员编辑后端代码
留言管理.php 代码如下:
<?php session_start(); if(!isset($_SESSION['isadmin']) || !$_SESSION['isadmin']) { echo "<script>alert('请以管理员的的身份登录后,在进入后台。');location.href='index.php';</script>"; exit; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>留言板</title> <style> .main{width= 80%;margin: 0 auto;text-align:center} .current{color:darkgreen} h2{text-align:center;font-size:20px;} h2 a{margin-right: 15px; color:navy ;text-decoration: none} h2 a:hover{color:aqua;text-decoration:underline} h2 a:last-child{margin-right:0px} tr:hover{background-color:azure} body { background:url('./10.jpeg') no-repeat center top; background-size:cover; /* background="./127.jpg" background-size:cover; */ } </style> </head> <body > <div class="main"> <h1>留言板</h1> <h2> <a href="index0.php" >1:首页 </a> <a href="展示留言.php" class="current">3:显示留言 </a> <a href="revise.php" >4:个人资料修改 </a> <a href="admin.php" >5:后台管理</a></br> </h2> <?php include_once 'conn.php'; $sql="select * from speak order by id desc";//order by id desc 作用是让查到的数据id按照有大到下的顺序排列。 $result=mysqli_query($conn,$sql); ?> <table align="center" border="1" width="100%" cellspacing="0" cellpadding="10" styel="border-collapase: collapse" > <tr> <td>序号</td> <td>用户名</td> <td>姓名</td> <td>留言</td> <td>时间</td> <td>操作</td> </tr> <tr> <?php $i=1; while($info=mysqli_fetch_array($result))//mysqli_fetch_array()从结果集中取得一行作为数字数组或关联数组 //返回与读取行匹配的字符串数组。如果结果集中没有更多的行则返回 NULL。 {?> <tr> <td><?php echo $i;?></td> <td><?php echo $info['username'];?></td> <td><?php echo $info['name'];?></td> <td><?php echo $info['speak'];?></td> <td><?php echo $info['createTime'];?></td> <td> <a href="编辑留言.php?id=<?php echo $info['id'];?>">编辑留言</a> <a href="javascript:del(<?php echo $info['id'];?>,'<?php echo $info['name'];?>')">删除留言</a> </tr> <?php $i++; } ?> </tr> </table> </div> <script> function del(id,name) { if(confirm('您确定要删除 '+name+' 的留言吗?')) { location.href='删除后端.php?id='+id+'&username='+name; } } </script> </body> </html>
##第一次写博客,写得不好多有见谅,希望对大家学习PHP有所帮助,如有疑问或者改进方法请留言 我这个代码是和会员注册管理相结合来写的我觉得不适合速成的同学来看。
-
php留言板代码,php留言板_wcoj2x_php_
2021-09-29 15:33:31php源码实现,php留言板代码,里面有详细的源代码。希望能够帮助一些初学者。 -
php留言板完整实例源码
2013-06-15 17:25:01包括用户注册、用户登录、头像上传、用户资料、无限级别回复留言等功能;使用PHP+MySQL+Ajax技术实现,无刷新提交内容,前后台数据验证…… -
php留言板程序
2015-05-11 11:38:57这是基于php,和前端框架bootstrap开发的留言板程序,界面简洁大方!很适合php入门者参考,刚刚开始学,就得学习别人写的代码,才会有进步, -
原生PHP留言板
2018-01-26 09:21:36//需要mysql扩展 PHP运行环境 (PHP7已移除MySQL扩展) require_once(__SITE_ROOT . '/includes/mysql.lib.php'); //需要mysqli扩展 (PHP7不建议使用, 运行环境 ) [在7运行的话, 将mysqli.lib.php 里的所有MYSQL_... -
PHP留言板小项目(大作业)
2014-05-21 18:13:55学校期末考试PHP大作业包括源码+项目报告 -
php留言板制作教程x_php制作留言板实例
2020-09-14 14:24:33PAGE / NUMPAGES PHP留言板案例教程-前言 网络上各种各样的PHP教程和各种各样的留言板都是铺天盖地的战地为什么要自己写一个这样的 PHP留言板教程呢问的好啊鼓掌 首先战地写这个PHP教程的目的不是为了做一个留言板... -
php制作文本式留言板
2020-12-18 12:30:20我的留言板</title> </head> <body> <?php include(“menu.php”); ?> 删除留言 <?php $id=$_GET[“id”]; $info=file_get_contents(“liuyan.txt”); $lylist=... -
PHP 留言模板代码
2018-09-29 16:08:36对于初学者学习PHP的留言模板方面有帮助,里面有详细的代码,效果图 -
PHP留言板.docx
2020-04-21 17:28:20设计一个留言板系统,实现小范围的用户信息交流,采用人机对话的操作方式,实 现了B/S系统结构,界面设计友好,信息查看灵活、快速,数据存储安全,保密性较好,只允许特定用户具有以下操作:输入账号密码登录后,... -
XYCMS PHP留言板源码 v1.8.rar
2019-07-10 17:12:29XYCMS PHP留言板源码,适合作为PHP平台企业网站、公司网站的客户留言或联系我们栏目使用,界面简洁大气,和主系统独立,可单独作为网站的一个功能模块来用,运行界面如截图所示。 因留言本使用有图形验证码,因此...