?? admin_modifypassword.asp
字號:
<!--#include file="inc/Conn.asp"-->
<!--#include file="inc/md5.asp" -->
<!--#include file="Admin_IsLogin.asp" -->
<%
If Request.Querystring("action")="post" Then
Dim OldPwd,NewPwd,NewPwd2,mUserName
Dim rs,rsw,mSql
mUserName=Session.Contents("CurUserName")
mOldPwd=Trim(Request.Form("txtOldPwd"))
mNewPwd=Trim(Request.Form("txtNewPwd"))
mNewPwd2=Trim(Request.Form("txtNewPwd2"))
mSql="Select F_PassWord From fyasp_Admin Where F_UserName='" & mUserName & "'"
set Rs=conn.Execute(mSql)
If rs("F_Password")<>md5(mOldPwd) then
response.write "<script>alert('舊密碼輸入錯誤!');history.back();</Script>"
response.end
else
Set Rsw=server.createobject("Adodb.recordset")
mSql="select F_PassWord from fyasp_Admin Where F_UserName='" & mUserName & "'"
Rsw.open mSql,conn,1,3
Rsw("F_PassWord")=md5(mNewPwd)
Rsw.update
Rsw.close
set Rsw=Nothing
response.write "<script>alert('密碼修改成功!');history.back();</Script>"
end if
end if
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/Style.css" rel="stylesheet" type="text/css">
<script language="javascript">
function checkdata()
{
if (document.all.txtOldPwd.value=="")
{
alert("密碼不能為空,請輸入舊密碼!")
document.all.txtOldPwd.focus()
return false;
}
if (document.form1.txtNewPwd.value=="")
{
alert("密碼不能為空,請輸入新密碼!")
document.form1.txtNewPwd.focus()
return false;
}
if (document.form1.txtNewPwd2.value=="")
{
alert("密碼不能為空,請輸入確認密碼!")
document.form1.txtNewPwd2.focus()
return false;
}
if (document.form1.txtNewPwd.value!=document.form1.txtNewPwd2.value)
{
alert("您兩次輸入的密碼不一致,請重新輸入!");
document.form1.txtNewPwd.focus();
return false;
}
}
</script>
</head>
<BODY leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<br>
<TABLE class=tableBorder cellSpacing=1 cellPadding=3 width="95%" align=center
border=0>
<TBODY>
<TR>
<TH width="100" height=25 align="center" class=tableHeaderText>操作提示</TH>
</TR>
<TR>
<TD class=forumrow> <P><B>注意</B>:<BR>
如果您想更改密碼,請先輸入舊密碼,然后再輸入新密碼及確認密碼。新密碼和確認密碼必須一致<BR>
</P></TD>
</TR>
</TBODY>
</TABLE>
<form name="form1" method="post" action="Admin_ModifyPassword.asp?action=post" onSubmit="return checkdata()">
<table class=tableBorder width="95%" border=0 align="center" cellpadding=5 cellspacing=1>
<tbody>
<tr>
<th height=21 colspan="2" sytle="line-height:150%">【修改密碼】</th>
</tr>
<tr>
<td width="15%" class=forumRow>輸入舊密碼:</td>
<td width="85%" class=forumRowHighlight><input class="INPUT" type="password" name="txtOldPwd"></td>
</tr>
<tr>
<td class=forumRow>輸入新密碼:</td>
<td class=forumRowHighlight><input class="INPUT" type="password" name="txtNewPwd"></td>
</tr>
<tr>
<td class=forumRow>新密碼確認:</td>
<td class=forumRowHighlight><input class="INPUT" type="password" name="txtNewPwd2"></td>
</tr>
<tr>
<td class=forumRow> </td>
<td class=forumRowHighlight> <input type="submit" value="提交信息" name="B32" >
<input type="reset" value="重新來過" name="B32" ></td>
</tr>
</tbody>
</table>
</form>
<P></P>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -