📄 updatepassword_confirm.jsp
字号:
<%@ page language="java" import="java.sql.*" pageEncoding="gb2312" errorPage="errorpage.jsp"%>
<%@page import="oabean.database"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>确定更新</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body link="#66FF00">
<p align="center">
<%
try{
String userId=(String)session.getAttribute("userId");
if(userId==null){response.sendRedirect("../index.jsp");}
String formerpwd=request.getParameter("formerpwd");
String newpwd=request.getParameter("pwd");
// String userId="33";
database db=new database();
String password="";
String userPassword="";
String sql="select userPassword from oa_user where userId='"+userId+"'";
ResultSet rs=db.executeQuery(sql);
if(rs.next())
{
password=rs.getString("userPassword");
rs.close();
}
oabean.security md5=new oabean.security();
formerpwd=md5.encryptPWD(formerpwd);
if(formerpwd.equals(password))
{
userPassword=md5.encryptPWD(newpwd);
sql="update oa_user set userPassword='"+userPassword+"' where userId='"+userId+"'";
if(db.executeUpdate(sql))
{
out.println("修改密码成功!!!!");
}
else
{
out.println("修改密码失败!!!!");
}
}
else
{
throw new Exception("原始密码输入错误,无法完成密码修改!!!");
}
} catch(Exception e)
{
e.printStackTrace();
out.print(e.getMessage());
}
%></p>
<meta http-equiv="refresh" content="2;url=perdesign.jsp">
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -