login.asp

来自「基于ASP报表的设计与实现 基于ASP报表的设计与实现 基于ASP报表的设计与实」· ASP 代码 · 共 33 行

ASP
33
字号
<!--#include file="connection.asp"-->

<%
dim xuid,xpass,checkpass
xuid = request("userid")
xpass = request("pass")

if instr(1,xuid,"'") > 0 then
	xuid = replace(xuid,"'","''")
end if
if instr(1,xpass,"'") > 0 then
	xpass = replace(xpass,"'","''")
end if

conn.open = connstring
set rs = conn.execute ( "Select count(pass) from users where pass = '" & xpass & "' and userid = '" & xuid & "' and isactive = true")
if (len(xpass) = 0) or (len(xuid) = 0) then 
    	response.redirect "er_login.htm"
else
		if (rs(0) >= 1) then
			session("userid") = xuid
			Response.Redirect "main.asp"			
		else
			Response.Redirect "er_login.htm"
		end if
end if
 
rs.close
set rs = nothing
conn.close
set conn = nothing
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?