📄 admin_admin.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="jl.asp" -->
<!--#include file="error.asp"-->
<title>管理员选项</title>
<%
dim founderr,errmsg
if request.form("MM_insert") then
if request.form("action")="modpass" then
dim adminname,oldpwd,adminpwd,confirm
adminname=trim(replace(request.form("adminname"),"'",""))
oldpwd=trim(replace(request.form("oldpwd"),"'",""))
adminpwd=trim(replace(request.form("adminpwd"),"'",""))
confirm=trim(replace(request.form("confirm"),"'",""))
if adminname="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入管理员名称!"
end if
if oldpwd="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入旧的管理员密码!"
end if
if adminpwd="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入新的管理员密码!"
end if
if adminpwd<>confirm then
founderr=true
errmsg=errmsg+"<br>"+"<li>你两次输入的管理员密码不相同!"
end if
if founderr then
call diserror()
response.end
else
sql="select * from admin where admin='"&adminname&"' and pws='"&oldpwd&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if rs.eof then
errmsg=errmsg+"<br>"+"<li>管理员名称或密码错误!"
call diserror()
response.end
else
rs("pws")=adminpwd
rs.update
rs.close
set rs=nothing
end if
end if
end if
if request.form("action")="newadmin" then
adminname=trim(replace(request.form("adminname"),"'",""))
adminpwd=trim(replace(request.form("adminpwd"),"'",""))
confirm=trim(replace(request.form("confirm"),"'",""))
if adminname="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入管理员名称!"
end if
if adminpwd="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入管理员密码!"
end if
if adminpwd<>confirm then
founderr=true
errmsg=errmsg+"<br>"+"<li>你两次输入的管理员密码不相同!"
end if
if founderr then
response.end
else
sql="select * from admin"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("admin")=adminname
rs("pws")=adminpwd
rs.update
rs.close
set rs=nothing
response.redirect "admin_admin.asp?action=admin"
end if
end if
if request.form("action")="editadmin" then
if request.Form("id")="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
if not isInteger(request.form("id")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的文章分类id参数。"
end if
end if
adminname=trim(replace(request.form("adminname"),"'",""))
adminpwd=trim(replace(request.form("adminpwd"),"'",""))
confirm=trim(replace(request.form("confirm"),"'",""))
if adminname="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入管理员名称!"
end if
if adminpwd="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须输入管理员密码!"
end if
if adminpwd<>confirm then
founderr=true
errmsg=errmsg+"<br>"+"<li>你两次输入的管理员密码不相同!"
end if
if founderr then
call diserror()
response.end
else
sql="select * from admin where admin_id="&request.form("id")
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs("admin")=adminname
rs("pws")=adminpwd
rs.update
rs.close
set rs=nothing
end if
end if
end if
%>
<table width="98%" border="0" cellspacing="1" cellpadding="10" bgcolor="#B9B9B9">
<tr align="center">
<td bgcolor="#E8E8E8" width="50%" class="chinese" background="images/pic000/c007.jpg"><a href="admin_admin.asp?action=modpass">修改管理员密码</a></td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="6"></td>
</tr>
</table>
<%if request.querystring("action")="modpass" then%>
<table width="98%" border="1" cellspacing="0" cellpadding="4" bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#C0C0C0">
<form name="form1" method="post" action="admin_admin.asp">
<tr>
<td class="diaryhead" background="images/pic000/c005.jpg"> <font color="#333333">修改管理员密码</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="chinese">管理员名称-
<input type="text" name="adminname" size="30" class="textarea">
旧密码-
<input type="password" name="oldpwd" size="30" class="textarea">
</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="chinese">新密码-
<input type="password" name="adminpwd" size="30" class="textarea">
确认新密码-
<input type="password" name="confirm" size="30" class="textarea">
</td>
</tr>
<tr>
<td bgcolor="#F5F5F5" height="30" align="center">
<input type="submit" name="Submit" value="确定修改" class="button">
<input type="reset" name="Reset" value="清空重写" class="button">
</td>
</tr>
<input type="hidden" name="action" value="modpass">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -