📄 achgpass.jsp
字号:
<%@ page contentType="text/html; charset=utf-8" import="java.lang.*" import="java.util.*"%>
<%@page import="java.sql.*" %>
<html>
<jsp:useBean id="achgpass" scope="session" class="bean.AChgpass" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改管理员<%=(String)session.getAttribute("name")%>的密码</title>
</head>
<body>
<h3>修改管理员<%=(String)session.getAttribute("name")%>的密码</h3>
<a href="amain.jsp">返回</a>
<form name="chgpassform" action="Achgpass.jsp" method="post">
<p>
旧密码: <input name="oldpass" type="password" size="10" maxlength="10">
</p>
<p>
新密码: <input name="newpass" type="password" size="10" maxlength="10">
</p>
<p>
确认密码:<input name="confpass" type="password" size="10" maxlength="10">
</p>
<p>
<input type="submit" name="submit" value="确认">
</p>
</form>
<%
int i=0;
String oldpass;
String newpass;
String confpass;
String name=(String)session.getAttribute("name");
if(request.getParameter("submit")!=null){
oldpass=request.getParameter("oldpass");
newpass=request.getParameter("newpass");
confpass=request.getParameter("confpass");
}
else{
oldpass=new String();
newpass=new String();
confpass=new String();
}
if(newpass.equals(confpass)&&request.getParameter("submit")!=null){
i=achgpass.setPass(name,oldpass,newpass);
if(i==0)
out.println("<p>未知错误");
else if(i==1){
out.println("<p>密码修改成功");
session.setAttribute("pass",newpass);
}
else if(i==2)
out.println("<p>旧密码输入错误");
}
else if(request.getParameter("submit")!=null)
out.println("<p>两次密码不一致");
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -