PassUpdate.asp
上传用户:dbstep
上传日期:2022-08-06
资源大小:2803k
文件大小:4k
- <HTML>
- <HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
- <TITLE>修改密码</TITLE>
- <link rel="stylesheet" href="Images/CssAdmin.css">
- <script language="javascript" src="../skweb/JS/Admin.js"></script>
- </HEAD>
- <!--#include file="../skweb/Const.asp" -->
- <!--#include file="../skweb/ConnSiteData.asp" -->
- <!--#include file="../skweb/Md5.asp"-->
- <!--#include file="CheckAdmin.asp"-->
- <%
- if Instr(session("AdminPurview"),"|111,")=0 then
- response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
- response.end
- end if
- '========判断是否具有管理权限
- %>
- <body>
- <%
- select case request.QueryString("Action")
- case "ModifyPass"
- SaveNewPass
- case else
- end select
- %>
-
- <table width="100%" border="0" cellpadding="3" >
- <form name="editForm" method="post" action="PassUpdate.asp?Action=ModifyPass&LoginName=<%=session("AdminName")%>" >
- <tr>
- <td height="24" nowrap bgcolor="#EBF2F9"><table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" id=editProduct idth="100%">
- <tr>
- <td width="77" height="20" align="right" bgcolor="#FFFFFF"> </td>
- <td width="1329" bgcolor="#FFFFFF"> </td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">登 录 名:</td>
- <td bgcolor="#FFFFFF"><input name="AdminName" type="text" class="textfield" id="AdminName" style="WIDTH: 120;" value="<%=session("AdminName")%>" maxlength="16" readonly> 3-10位字符,不可修改</td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">新 密 码:</td>
- <td bgcolor="#FFFFFF"><input name="NewPassword" type="password" class="textfield" id="NewPassword" maxlength="20" style="WIDTH: 120;"> * 注意字母大小写</td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF">确认密码:</td>
- <td bgcolor="#FFFFFF"><input name="vNewPassword" type="password" class="textfield" id="vNewPassword" maxlength="20" style="WIDTH: 120;"> *</td>
- </tr>
- <tr>
- <td height="30" align="right" bgcolor="#FFFFFF"> </td>
- <td valign="bottom" bgcolor="#FFFFFF"><input name="submitSaveEdit" type="submit" class="button" id="submitSaveEdit" value="保存" style="WIDTH: 60;" ></td>
- </tr>
- <tr>
- <td height="20" align="right" bgcolor="#FFFFFF"> </td>
- <td valign="bottom" bgcolor="#FFFFFF"> </td>
- </tr>
- </table></td>
- </tr>
- </form>
- </table>
- </body>
- </html>
- <%
- function SaveNewPass()
- dim LoginName,rs,sql
- LoginName=request.QueryString("LoginName")
- set rs = server.createobject("adodb.recordset")
- sql="select * from sk_Admin where AdminName='"&LoginName&"'"
- rs.open sql,conn,1,3
- if rs.bof and rs.eof then
- response.write "读取数据库记录出错!"
- response.end
- else
- if len(trim(Request.Form("NewPassword")))<6 or len(trim(Request.Form("NewPassword")))>20 then
- response.write "<script language=javascript> alert('管理员密码必填,且字符数为6-20位!');history.back(-1);</script>"
- response.end
- end if
- if Request.Form("NewPassword")<>Request.Form("vNewPassword") then
- response.write "<script language=javascript> alert('两次输入的密码不一样!');history.back(-1);</script>"
- response.end
- end if
- rs("Password")=Md5(Request.Form("NewPassword"))
- rs.update
- rs.close
- set rs=nothing
- end if
- response.write " <br>你的管理密码已成功修改,请牢记[ <font color='red'>"&trim(Request.Form("NewPassword"))&"</font> ]!<br><a href='vbscript:window.close'>关闭窗口</a>"
- response.end
- end function
- %>