📄 admin_check.asp
字号:
<%
'========================================
'只返回字母和数字
'调用方式text=cchar(text)
'=========================================
function cchar(para)
on error resume next
dim str
dim chstr
dim c
dim i
if isNUll(para) then
cchar=""
exit function
end if
str=cstr(para)
if trim(str)="" then
cChar=""
exit function
end if
for i=1 to len(str)
c=asc(mid(str,i,1))
if c>=48 and c<=57 or c>=65 and c<=90 or c>=97 and c<=122 then
chstr=chstr & chr(c)
end if
next
cChar=chstr
if err.number<>0 then err.clear
end function
'+++++++++++++++++++++++++++++++++++++
'◆模块名称: 管理员登陆检查
'+++++++++++++++++++++++++++++++++++++
sub admin_login()
adminname=cchar(trim(request.form("adminname")))
adminpass=cchar(trim(request.form("adminpass")))
if adminname<>"" and adminpass<>"" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from admin where 管理员名='"&adminname&"' and 密码='"&adminpass&"'",conn,1,1
if rs.eof then
response.write "<font color=red>×</font>用户名或密码错误!"
else
session("adminname")=rs("管理员名")
session("grade")=rs("级别")
response.write "登陆成功!"
response.redirect "admin_index.asp"
response.end
end if
end if
end sub
'+++++++++++++++++++++++++++++++++++++
'◆模块名称: 管理员级别检查
'◆传入参数: grade (管理员级别), adminname (管理员名称) i(是否拥有该页权限)
'+++++++++++++++++++++++++++++++++++++
sub manager(grade,adminname,i)
if grade<>"" and i<>"" and adminname<>"" then
if grade<i then
response.write"<center><br><br><br>提示信息:<font color=red>此项操作只有超级管理员才能完成!</font>"
response.redirect "admin_index.asp"
response.end
end if
else
response.write"<center><br><br><br>提示信息:<font color=red>请确认您的管理员身份!<br>管理员名:"&adminname&"<br>您的级别:"&grade&"<br>该页权限:"&i&"级<br>"
response.redirect "admin_login.asp"
response.end
end if
end sub
'+++++++++++++++++++++++++++++++++++++
'◆模块名称: 在i秒后转到相应页面
'◆传入参数: url 网址, i 秒数
'◆示例: response.write ref("admin_index.asp",2) 2秒后返回admin_index.asp页面
'+++++++++++++++++++++++++++++++++++++
function ref(url,i)
response.write"<meta http-equiv=refresh content="&i&";URL="&url&">"
response.write"<center><br><font color=red>"&i&"</font> 秒后自动返回 ....如不想等待请<a href="&url&">点击</a></center>"
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -