【发布时间】:2023-03-23 20:09:01
【问题描述】:
我在php中有如下代码sn-p
if($userName==$dbUserName&&md5($passWord)==$dbPassWord){
echo "<input name='username' type='hidden' value='$userName'>";
header('Location: http://localhost:8080/ClientModule/student.jsp');
die();
}
php 重定向到下面的jsp
<%@page contentType="text/html" pageEncoding="UTF-8" errorPage="error.jsp"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Student Home</title>
</head>
<body>
<h1>
Logged in as: ${param.username}
</h1>
<nav>
<p><a href="student.jsp">Home</a></p>
<p><a href="profile.jsp">Profile</a></p>
<p><a href="tutorList.jsp">Teachers</a></p>
<p><a href="studentNotifs.jsp">Notifications</a></p>
</nav>
</body>
</html>
我一定是在 php 文件中做错了什么,有人可以帮我找出来吗? 非常感谢任何帮助
【问题讨论】:
-
检查您的
$username$dbUserName和$dbPassword是否正确。