pwd.jsp~21~
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:2k
源码类别:
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">
- <%
- String pwd="";
- String number=(String)session.getAttribute("id");
- String sql="";
- sql="SELECT * FROM student where stu_id='"+number+"'";
- ResultSet rs = a.executeQuery(sql);
- if(rs.next()){
- pwd=rs.getString("stu_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>
- 学号: <font color="#FF3333"><%=session.getAttribute("id") %></font> 姓名: <font color="#FF3333"><%=session.getAttribute("stu_name") %> </font> <br>
- <hr><br>
- <center>
- <form action="update_pwd.jsp" method="POST" name="form2">
- <table border="1" width="100%">
- <tr align="center"><td align="center"><font size="4" color="#FF3333">密码修改</font></td></tr>
- <tr align="center">
- <td >请输入原始密码</td><td ><input type="password" name="pwd1" size="15"> </td>
- </tr>
- <tr align="center">
- <td >请输入新密码</td> <td ><input type="password" name="pwd2" size="15"> </td>
- </tr>
- <tr align="center">
- <td >确认新密码</td><td ><input type="password" name="pwd3" size="15" > </td>
- </tr>
- <tr align="center">
- <td ><input type="submit" name="a1" value="确认" onclick="return b()"> </td><td ><input type="reset" name="a2" value="重写"></td>
- </tr>
- </table>
- </form>
- </center>
- </body>
- </html>