ad_pwd.jsp~7~
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:3k
源码类别:

Jsp/Servlet

开发平台:

VBScript

  1. <%@ page contentType="text/html; charset=GBK" %>
  2. <%@ page import="java.sql.*" %>
  3. <%@ page language="java" %>
  4. <%@ page import="java.util.*" %>
  5. <%@ page import="proj112.*" %>
  6. <jsp:useBean id="a" scope="page" class="proj112.dbconn"/>
  7. <html>
  8. <head>
  9. <meta http-equiv="Content-Type" content="text/html; charset=gb2312";>
  10. <title>
  11. change
  12. </title>
  13. </head>
  14. <body bgcolor="#ffffff">
  15. <br>
  16.    <%
  17.    String pwd="";
  18.    String number=(String)session.getAttribute("id");
  19.    String sql="";
  20.      sql="SELECT * FROM admin where name='"+number+"'";
  21.      ResultSet rs = a.executeQuery(sql);
  22.      if(rs.next()){
  23.        pwd=rs.getString("ad_password");
  24.      }
  25.    %>
  26. <SCRIPT LANGUAGE="javascript" >
  27.  function b(){
  28.          if(form2.pwd1.value!=<%=pwd%>)
  29.          {
  30.                 alert("输入的原始密码不正确,请重新输入");
  31.                 form2.pwd1.focus();
  32.                 return false;
  33.          }
  34.            if(form2.pwd2.value=="")
  35.            {
  36.                    alert("请输入新密码");
  37.                    form2.pwd2.focus();
  38.                  return false;
  39.                   }
  40.             else if(form2.pwd2.value!=form2.pwd3.value)
  41.               {
  42.                  alert("两次输入的新密码不同,请重新输入");
  43.                  form2.pwd3.focus();
  44.                  return false;
  45.               }
  46.              else
  47.             {
  48.               alert("密码修改成功");
  49.               return true;
  50.             }
  51.             return true;
  52.  }
  53. </SCRIPT>
  54.  <center>
  55.  <form action="update_ad_pwd.jsp" method="POST" name="form2">
  56. <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"
  57. borderColor=#cc9966 cellSpacing=0 cellPadding=4 rules=all border=1>
  58.    <tr align="center"><td  colspan="2" align="center"><font size="4" color="#FF3333">密码修改</font></td></tr>
  59.   <tr align="center">
  60.     <td  align="right">请输入原密码</td><td  align="left"><input type="password" name="pwd1"  size="15"> </td>
  61.   </tr>
  62.   <tr align="center">
  63.     <td  align="right">请输入新密码</td> <td  align="left"><input type="password" name="pwd2" size="15"> </td>
  64.   </tr>
  65.   <tr align="center">
  66.   <td  align="right">确认新密码</td><td  align="left"> <input type="password" name="pwd3" size="15" > </td>
  67.   </tr>
  68.   <tr align="center">
  69.   <td  align="right"><input type="submit" name="a1" value="确认" onclick="return b()"> </td><td  align="left"> <input type="reset" name="a2" value="重写"></td>
  70.   </tr>
  71.  </table>
  72.   </form>
  73.   <img src="img/boshi.jpg">
  74.  </center>
  75. </body>
  76. </html>