当前位置: 首页 > news >正文

PHP留言板实现

完整教程PHP留言板

登陆界面

一个初学者的留言板(登录和注册)_php留言板登录注册-CSDN博客

留言板功能介绍

百度网盘 请输入提取码 进入百度网盘后,输入提取码:knxt,即可下载项目素材和游客访问页面的模板文件。

<?php session_start(); ?> 
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>登陆</title>
</head>
<body>
<center>
<h1>登陆</h1>
<?php
include "conn.php";
if (isset($_POST["submit"])){if (empty($_POST["user"]) or empty($_POST["password"])) {echo  "<font color='red'> 用户名或者密码不能为空,请重新输入!</font>";}else{$user = $_POST["user"];$password = $_POST["password"];$sql = "select * from user where username = '$user' and password = '$password'";//echo $sql;$result = mysqli_query($conn,$sql);if (mysqli_num_rows($result) > 0) {//echo "<font color='green'>登陆成功!</font>";$persion = mysqli_fetch_array($result);//取结果集result的值赋给persion$_SESSION["username"] = $persion["username"];//session取值方便后面的使用//echo $_SESSION["username"];$_SESSION["uid"] = $persion["uid"];//echo $_SESSION["uid"];echo "<script>alert('登陆成功')</script>";}else{echo "<font color='red'>用户名或者密码不存在!</font>";}}}
?><form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post" > <table border="0" >
<tr >
<td >用户名</td>
<td ><input type="text" name="user" ></td>
</tr>
<br />
<tr>
<td>密码</td>
<td><input type="password" name="password"></td>
</tr>
<br />
<tr>          <!--colspan 属性规定单元格可横跨的列数。-->
<td colspan="2" align="center"><input type="submit" value="登陆" name="submit">
<input type="submit" name="zhuce" value="注册" onClick="window.open('zhuce.php')">
<!--<input type="button" value="注册" οnclick="document.location.href='http://127.0.0.1/5.php'" >--></td></tr>
</table>
</form></center>
</body>
</html>

http://www.lryc.cn/news/281366.html

相关文章:

  • ssm+vue的物流配送人员车辆调度管理系统的设计与实现(有报告)。Javaee项目,ssm vue前后端分离项项目。
  • day1·算法-双指针
  • 在vue中,切换页面之后如何关闭定时器
  • 观测云产品更新 | 日志、场景仪表板、监控器等
  • 【JupyterLab】在 conda 虚拟环境中 JupyterLab 的安装与使用
  • HTML--JavaScript--引入方式
  • 第28关 k8s监控实战之Prometheus(七)
  • SSC | Blue Prism报告:2024年智能自动化(IA)7大趋势预测
  • el-tree定义左边箭头,包括下级出现连线
  • C++ 多线程顺序打印
  • x-cmd pkg | duf - df 命令的现代化替代品
  • 202406读书笔记|《沉睡的线条世界》——翻山越岭,只为与你分享点滴的快乐
  • [论文阅读]4DRadarSLAM: A 4D Imaging Radar SLAM System for Large-scale Environments
  • Python: vars()详细解释
  • 2024年1月15日Arxiv最热论文推荐:斯坦福LLM精准微调新框架、GPT不愿承认回答错误、速度快15倍的3D全景分割新突破
  • 1.5 面试经典150题 - 轮转数组
  • Linux的基础命令学习
  • 个人数据备份方案分享(源自一次悲惨经历)
  • SpringBoot教程(八) | SpringBoot统一结果封装
  • Ubuntu 22.04 安装Fail2Ban
  • Ubuntu 22.04 编译安装 Qt mysql驱动
  • Mindspore 公开课 - CodeGeeX
  • 说一下mysql的锁
  • rime中州韵小狼毫 日期/农历 时间 事件 节气 滤镜
  • 【前端】前后端的网络通信基础操作(原生ajax, axios, fetch)
  • Matter - 配置工厂数据(2)
  • 版本控制背景知识
  • tensorflow报错: DNN library is no found
  • DA14531-高级应用篇-用户如何开启OTA服务
  • 国内镜像源配置方法(包括临时和永久方法)