对asp有兴趣的请进

来源:百度知道 编辑:UC知道 时间:2024/05/04 05:03:02
<%
if session("user")="" then
Response.Redirect "index.asp"
response.end
else
Set admin = Server.CreateObject("ADODB.Recordset")
asql="SELECT * FROM admin where admin='"&session("user")&"'"
admin.OPEN asql, Conn,1,1
if admin.eof and admin.bof then
Response.Redirect "index.asp"
response.end
else
if session("pas")<>admin("pws") then
Response.Redirect "index.asp"
response.end
else
if session("qx")<"2" then
Response.Redirect "putong.asp"
response.end
end if
end if
end if
admin.close
set admin=nothing
end if%>
能否翻译一下.谢谢!!
怎么米没有人那???

没分的苦差只有我来做了,
帮你简单的讲解一下吧
<%
if session("user")="" then
Response.Redirect "index.asp"
response.end
'如果session("user")为空(一般是指没登录过)就进入首页(index.asp)

else
Set admin = Server.CreateObject("ADODB.Recordset")
asql="SELECT * FROM admin where admin='"&session("user")&"'"
admin.OPEN asql, Conn,1,1
if admin.eof and admin.bof then
Response.Redirect "index.asp"
response.end

'如果不为空,则检测该帐号是不是在数据库里有记录,如果查不到相应记录,则也进入首页

else
if session("pas")<>admin("pws") then
Response.Redirect "index.asp"
response.end

'该帐号是在数据库里有记录,但密码不对也进入首页
else
if session("qx")<"2" then
Response.Redirect "putong.asp"
response.end

'如果上述要求都满足,且session("qx")<"2"