此留言板非常简单,漏洞也非常多,主要目的就是为了简单学习一下php mysql html,写完留言板后,再学习sql注入,这时你可以再完善留言板。
strlen()字符串长度函数
isset() 判断是否为被定义 定义返回ture
empty()判断是否为空 为空返回ture
array()创建数组count()数组个数
require "mysql_conf.php(连接数据库的代码文件)"
$sql = "mysql 语句";
$result = mysqli_query($conn,$sql);把sql语句输出出来的结果赋给result
mysqli_num_rows($result) 返回结果集中的行数
<script> window.location.href="show.php" </script>"; 跳转到当前目录下的shou.php文件
<a href="zhuce.php">注册</a> a标签 点击注册 跳转到zhuce.php
<input type="text" name="username" placeholder="用户名" required="" >
input标签 type 类型 name定义名称 placeholder在输入框中显示
colspan="2" align="center" 跨两行 居中
action="" method="post" 跳转的页面 传输类型
<textarea name="content" rows="10" cols="80"></textarea>留言框
<input type="hidden" name="uid" value="<?php echo $uid;?>">传uid
Cookie实际上是一小段文本信息,客户端请求服务器时,服务器就给客户端发一个
通行证,即cookie,当浏览器再请求该网站的时候,浏览器把请求的网址连同cookie
一块提交给服务器。服务器检查该cookie,以此辨认用户状态
session是另一种记录客户状态的机制,不同的是cookie保存在客户端,而session
保存在服务器上。客户端浏览器访问服务器的时候,服务器把客户端信息以某种形式
记录在服务器上。这就是session。客户端浏览器再次访问时只需要从该session中查找
该用户状态就可以了
登陆 denglu.php


注册 zhuce.php




登录后的页面 show.php


个人中心 percenter.php


添加留言 messageadd.php

删除留言 delmessage.php

上传图片 upload.php

?>
返回 loginout.php

连接数据库 mysql_conf.php

网友评论