ad_pwd.jsp~5~
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:3k
源码类别:
Jsp/Servlet
开发平台:
VBScript
- <%@ page contentType="text/html; charset=GBK" %>
- <%@ page import="java.sql.*" %>
- <%@ page language="java" %>
- <%@ page import="java.util.*" %>
- <%@ page import="proj112.*" %>
- <jsp:useBean id="a" scope="page" class="proj112.dbconn"/>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312";>
- <title>
- change
- </title>
- </head>
- <body bgcolor="#ffffff">
- <br><br><br>
- <%
- String pwd="";
- String number=(String)session.getAttribute("id");
- String sql="";
- sql="SELECT * FROM admin where name='"+number+"'";
- ResultSet rs = a.executeQuery(sql);
- if(rs.next()){
- pwd=rs.getString("ad_password");
- }
- %>
- <SCRIPT LANGUAGE="javascript" >
- function b(){
- if(form2.pwd1.value!=<%=pwd%>)
- {
- alert("输入的原始密码不正确,请重新输入");
- form2.pwd1.focus();
- return false;
- }
- if(form2.pwd2.value=="")
- {
- alert("请输入新密码");
- form2.pwd2.focus();
- return false;
- }
- else if(form2.pwd2.value!=form2.pwd3.value)
- {
- alert("两次输入的新密码不同,请重新输入");
- form2.pwd3.focus();
- return false;
- }
- else
- {
- alert("密码修改成功");
- return true;
- }
- return true;
- }
- </SCRIPT>
- <center>
- <form action="update_ad_pwd.jsp" method="POST" name="form2">
- <TABLE width="80%"style="BORDER-RIGHT: #cc9966 1px; BORDER-TOP: #cc9966 1px; BORDER-LEFT: #cc9966 1px; WIDTH: 100%; BORDER-BOTTOM: #cc9966 1px; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: white"
- borderColor=#cc9966 cellSpacing=0 cellPadding=4 rules=all border=1>
- <tr align="center"><td colspan="2" align="center"><font size="4" color="#FF3333">密码修改</font></td></tr>
- <tr align="center">
- <td align="right">请输入原密码</td><td align="left"><input type="password" name="pwd1" size="15"> </td>
- </tr>
- <tr align="center">
- <td align="right">请输入新密码</td> <td align="left"><input type="password" name="pwd2" size="15"> </td>
- </tr>
- <tr align="center">
- <td align="right">确认新密码</td><td align="left"> <input type="password" name="pwd3" size="15" > </td>
- </tr>
- <tr align="center">
- <td align="right"><input type="submit" name="a1" value="确认" onclick="return b()"> </td><td align="left"> <input type="reset" name="a2" value="重写"></td>
- </tr>
- </table>
- </form>
- </center>
- </body>
- </html>