有一个SESSON问题.为什么验证不了,菜鸟问题
session_start();
if (isset($_POST['user_name']) && isset($_POST['user_passwd']))
{
$name=$_POST['user_name'];
$pass=$_POST['user_passwd'];
}
$result=mysql_query("select * from ab_user where user_name='$name' and user_passwd='$pass'");
$rows=mysql_num_rows($result);
if($rows > 0){
$_SESSION['username']=$name;
if (isset($_SESSION['username']))
{
echo '用户密码正确!成功进入... <br />';
echo "<meta http-equiv=\"refresh\" content=\"5;URL=u_expense.php\">";
}else{
echo '用户密码资料不正确,请再试一次... <br />';
echo "<meta http-equiv=\"refresh\" content=\"5;URL=login.php\">";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="css/vpm_printout.css" rel="stylesheet" type="text/css">
<title>无标题文档</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data">
<table width="298" border="0" align="center" class="text6_bold">
<tr>
<th colspan="2" scope="col">登陆验证</th>
</tr>
<tr>
<td width="117">用户名</td>
<td width="312"><input name="user_name" type="text" class="text6" id="user_name" /></td>
</tr>
<tr>
<td>密码</td>
<td><input name="user_passwd" type="password" class="text6" id="user_passwd" /></td>
</tr>
</table>
<p align="center">
<input name="Submit" type="submit" class="text6" value="登陆" />
</p>
</form>
</body>
</html>
相关推荐
Springboot+vue3在线预约系统
Springboot+vue3 MySQL,使用ElementPlus
基于SpringBoot+Vue的学生选课管理系统的毕业设计,Vue+SpringBoot+MybatisPlus+MySQL
本文主要介绍基于SpringBoot+Vue的学生选课管理系统的源码实现。该系统实现了学生选课、退课、课程管理、学生管理等功能,采用前后端分离的模式,前端使用Vue框架,后端使用SpringBoot框架。 后端使用SpringBoot+MybatisPlus+MySQL实现,主要包括CourseController、StudentController、CourseService、StudentService等,实现课程CRUD、学生CRUD等接口。 前端使用Vue+ElementUI实现,主要包括Course.vue、Student.vue、Login.vue等组件,实现课程列表、学生列表、登录等页面。 登录页面Login.vue实现登录和注册功能,调用后端接口验证用户名和密码是否正确,登录成功后跳转到课程列表页面。 课程列表页面Course.vue实现课程查询、添加、修改、删除功能,调用后端CourseController相关接口,并使用ElementUI提供的表格组件展示课程数据。 学生列表页面Student.vue实现学生查询、添加、修改、删除功能,调用后端StudentCont
酒店管理平台(element+vuejs+springboot+mybatis)
酒店管理平台(element+vuejs+springboot+mybatis项目),code目录中是前后端代码,另外一个是部署文件,包含脚本,登录时用户名和密码随意
基于SpringBoot+Vue+ElementUI的人事管理系统
基于SpringBoot+MyBatis+Vue+Element的人事管理系统. 包含源代码、数据库DDL SQL、初始化数据SQL等,可以基于此做二次开发,快速搭建自己的业务系统。
SpringBoot+Vue学生成绩管理系统
功能截图:https://blog.csdn.net/qq_37740841/article/details/108966763


基础编程
