chklogin.asp
来自「视频点播系统」· ASP 代码 · 共 40 行
ASP
40 行
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/conn.asp"-->
<%
if request.cookies("username")="" or request.cookies("password")="" then
response.cookies("username")=""
response.cookies("password")=""
response.write"<script language=javascript>alert('身份验证失败,请重新登陆');location.href = 'login.asp';</script>"
response.end
else
if myobj.ChkID(request.cookies("username"))=false then
response.cookies("username")=""
response.cookies("password")=""
response.write"<script language=javascript>alert('参数值格式错误,请重新登陆');location.href = 'login.asp';</script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents where agent_id='"&request.cookies("username")&"'",conn,1,1
if rs.eof then
rs.close
set rs=nothing
conn.close
set conn=nothing
response.cookies("username")=""
response.cookies("password")=""
response.write"<script language=javascript>alert('身份验证失败,请重新登陆');location.href = 'login.asp';</script>"
response.end
else
if request.cookies("password")<>rs("agent_pwd") then
rs.close
set rs=nothing
conn.close
set conn=nothing
response.cookies("username")=""
response.cookies("password")=""
response.write"<script language=javascript>alert('身份验证失败,请重新登陆');location.href = 'login.asp';</script>"
response.end
end if
end if
end if
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?