一个网站如何优化,牙科医院网站设计怎么做,防城港网站设计,wordpress 柚子皮下载完整教程PHP留言板
登陆界面
一个初学者的留言板#xff08;登录和注册#xff09;_php留言板登录注册-CSDN博客
留言板功能介绍 百度网盘 请输入提取码 进入百度网盘后#xff0c;输入提取码#xff1a;knxt#xff0c;即可下载项目素材和游客访问页面的模板文件。
登录和注册_php留言板登录注册-CSDN博客
留言板功能介绍 百度网盘 请输入提取码 进入百度网盘后输入提取码knxt即可下载项目素材和游客访问页面的模板文件。
?php session_start(); ?
!DOCTYPE html
html
head
meta http-equivContent-Type contenttext/html; charsetutf-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 colorred 用户名或者密码不能为空请重新输入/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 colorgreen登陆成功/font;$persion mysqli_fetch_array($result);//取结果集result的值赋给persion$_SESSION[username] $persion[username];//session取值方便后面的使用//echo $_SESSION[username];$_SESSION[uid] $persion[uid];//echo $_SESSION[uid];echo scriptalert(登陆成功)/script;}else{echo font colorred用户名或者密码不存在/font;}}}
?form action?php echo $_SERVER[PHP_SELF]; ? methodpost table border0
tr
td 用户名/td
td input typetext nameuser /td
/tr
br /
tr
td密码/td
tdinput typepassword namepassword/td
/tr
br /
tr !--colspan 属性规定单元格可横跨的列数。--
td colspan2 aligncenterinput typesubmit value登陆 namesubmit
input typesubmit namezhuce value注册 onClickwindow.open(zhuce.php)
!--input typebutton value注册 οnclickdocument.location.hrefhttp://127.0.0.1/5.php --/td/tr
/table
/form/center
/body
/html