📄 adminforget_passwd.asp
字号:
<!--#include file="top_diy.asp"-->
<%
'=========================================================
' 随然日记本(多用户版) Version:3.0
' Date: 2004-11-15
' Script Written by 随然(dampure)
' 随然日记本演示地址:http://www.suiran.cn
'=========================================================
' Copyright (C) 2003,2004 真露无香. All rights reserved.
' Web: www.yongzi.com
' Diary:http://www.suiran.cn
'=========================================================
%>
<TABLE cellSpacing=0 cellPadding=0 width=617 height=18 align=center bgColor=#ffffff
border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#ffffff>
<TABLE borderColor=#e3e3e3 cellSpacing=0 borderColorDark=#e3e3e3
cellPadding=0 width=609 align=center bgColor=#ffffff border=1
bordercolorlight="#E3E3E3">
<TBODY>
<TR bgColor=#e6e6e6>
<TD bgColor=#e6e6e6>
<%
if request("action")="user" then
username=request("username")
set rs=server.createobject("adodb.recordset")
sql="select * from superadmin where user='"&username&"'"
rs.open sql,conn,1,1
if rs.eof then
call user()
else
question=rs("question")
call checkanswer()
rs.close
end if
elseif request("action")="check" then
username=request("username")
set rs=server.createobject("adodb.recordset")
sql="select * from superadmin where user='"&username&"'"
rs.open sql,conn,1,1
if rs("answer")<>request("answer") then
call answer()
else
call setpass()
session("getadmin")=""&username
rs.close
end if
elseif request("action")="save" then
username=request("username")
if username="" then
%>
<script language=vbscript>
MsgBox "非法操作,请用正常方式提交!"
location.href = "adminforget_passwd.asp"
</script>
<%
else
call save()
end if
else
call content()
end if
%>
</TD>
</TR>
</TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=2 width=609 align=center border=0>
<TBODY>
<TR bgColor=#e6e6e6>
<TD width="10%"></TD>
</TR>
</TBODY>
</TABLE></TD></TR>
<TR>
<TD bgColor=#ffffff height=16>
<TABLE cellSpacing=0 cellPadding=3 width=609 align=center bgColor=#9c9a9d
border=0>
<TBODY>
<!--#include file="foot.asp"-->
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</DIV></TD></TR></TBODY></TABLE>
</BODY></HTML>
<%sub content%>
<SCRIPT language=JavaScript><!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.username.value == "")
{
alert("请输入你的用户名!");
theForm.username.focus();
return (false);
}
return (true);
}
//--></SCRIPT>
<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#ffffff> <FORM name=FrontPage_Form1
onsubmit="return FrontPage_Form1_Validator(this)" action=?action=user method=post>
<TABLE cellSpacing=0 cellPadding=6 width="85%" align=center
border=0>
<TBODY>
<TR>
<TD width="43%"> </TD>
<TD width="57%">
</TD>
</TR>
<TR bgColor=#f5f5f5>
<TD width="43%"> <DIV align=right>请输入你的用户名:</DIV></TD>
<TD width="57%"><INPUT class=input type=text size=15
name=username> </TD>
</TR>
<TR>
<TD width="43%"> <DIV align=right></DIV></TD>
<TD width="57%"><INPUT type=image height=21 src="images/tijiao.gif" width=74 border=0>
</TD>
</TR>
</TBODY>
</TABLE>
</FORM></TD>
</TR>
</TBODY>
</TABLE>
<%end sub%>
<%sub checkanswer%>
<SCRIPT language=JavaScript><!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.answer.value == "")
{
alert("请输入你的密码提示问题答案!");
theForm.answer.focus();
return (false);
}
return (true);
}
//--></SCRIPT>
<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#ffffff> <FORM name=FrontPage_Form1
onsubmit="return FrontPage_Form1_Validator(this)" action=?action=check method=post>
<TABLE cellSpacing=0 cellPadding=6 width="85%" align=center
border=0>
<TBODY>
<TR>
<TD width="43%"> </TD>
<TD width="57%"><INPUT type=hidden value="<%=username%>" name="username">
</TD>
</TR>
<TR bgColor=#f5f5f5>
<TD width="43%"> <DIV align=right>你的密码提示问题是:</DIV></TD>
<TD width="57%"><%=question%></TD>
</TR>
<TR bgColor=#f5f5f5>
<TD width="43%"> <DIV align=right>请输入你的密码提示问题答案:</DIV></TD>
<TD width="57%"><INPUT class=input type=text size=15
name=answer> </TD>
</TR>
<TR>
<TD width="43%"> <DIV align=right></DIV></TD>
<TD width="57%"><INPUT type=image height=21 src="images/tijiao.gif" width=74 border=0>
</TD>
</TR>
</TBODY>
</TABLE>
</FORM></TD>
</TR>
</TBODY>
</TABLE>
<%end sub%>
<%sub user%>
<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#ffffff>
<TABLE cellSpacing=0 cellPadding=6 width="90%" align=center border=0>
<TBODY>
<TR>
<TD></TD></TR>
<TR>
<TD> </TD></TR>
<TR>
<TD>
<DIV align=center><FONT color=#990000>没有这个用户!</FONT></DIV></TD></TR>
<TR>
<TD></TD></TR>
<TR>
<TD>
<DIV align=center><A href="#" onclick=history.back()><IMG
height=21 src="images/fanhui.gif" width=74 border=0></A>
</DIV></TD></TR>
<TR>
<TD></TD></TR></TBODY></TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<%end sub%>
<%sub answer%>
<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#ffffff>
<TABLE cellSpacing=0 cellPadding=6 width="90%" align=center border=0>
<TBODY>
<TR>
<TD></TD></TR>
<TR>
<TD> </TD></TR>
<TR>
<TD>
<DIV align=center><FONT color=#990000>密码提示问题答案错误!</FONT></DIV></TD></TR>
<TR>
<TD></TD></TR>
<TR>
<TD>
<DIV align=center><A href="#" onclick=history.back()><IMG
height=21 src="images/fanhui.gif" width=74 border=0></A>
</DIV></TD></TR>
<TR>
<TD></TD></TR></TBODY></TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<%end sub%>
<%sub setpass%>
<SCRIPT language=JavaScript><!--
function FrontPage_Form1_Validator(theForm)
{
if (theForm.newpass.value == "")
{
alert("请输入新密码!");
theForm.newpass.focus();
return (false);
}
if (theForm.newpass.value.length > 12)
{
alert("密码不能大于12位,请重新输入!");
theForm.newpass.focus();
return (false);
}
if (theForm.newpass2.value == "")
{
alert("请输入确认密码!");
theForm.newpass2.focus();
return (false);
}
if (theForm.newpass2.value.length > 12)
{
alert("密码不能大于12位,请重新输入!");
theForm.newpass2.focus();
return (false);
}
if (theForm.newpass.value != theForm.newpass2.value)
{
alert("两次输入密码不一致,请从新输入!");
document.FrontPage_Form1.newpass.value = "";
document.FrontPage_Form1.newpass2.value = "";
document.FrontPage_Form1.newpass.focus();
return (false);
}
return (true);
}
//--></SCRIPT>
<TABLE cellSpacing=0 cellPadding=0 width="90%" align=center border=0>
<TBODY>
<TR>
<TD vAlign=top bgColor=#ffffff> <FORM name=FrontPage_Form1
onsubmit="return FrontPage_Form1_Validator(this)" action=?action=save method=post>
<TABLE cellSpacing=0 cellPadding=6 width="85%" align=center
border=0>
<TBODY>
<TR>
<TD width="43%"> </TD>
<TD width="57%"><INPUT type=hidden value="<%=username%>" name="username">
</TD>
</TR>
<TR bgColor=#f5f5f5>
<TD width="43%"> <DIV align=right>请输入你的新密码:</DIV></TD>
<TD width="57%"><INPUT class=input type=password size=15
name=newpass> </TD>
</TR>
<TR bgColor=#f5f5f5>
<TD width="43%"> <DIV align=right>请输入确认新密码:</DIV></TD>
<TD width="57%"><INPUT class=input type=password size=15
name=newpass2> </TD>
</TR>
<TR>
<TD width="43%"> <DIV align=right></DIV></TD>
<TD width="57%"><INPUT type=image height=21 src="images/tijiao.gif" width=74 border=0>
</TD>
</TR>
</TBODY>
</TABLE>
</FORM></TD>
</TR>
</TBODY>
</TABLE>
<%end sub%>
<%sub save
set rs=server.createobject("adodb.recordset")
sql="select * from superadmin where user='"&username&"'"
rs.open sql,conn,1,3
rs("pwd")=request("newpass")
rs.update
rs.close
session("getadmin")=""
%>
<script language=vbscript>
MsgBox "操作成功,请点击返回!"
location.href = "admin/admlogin.asp"
</script>
<%end sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -