checklogin.asp

来自「<1> 优化了部分代码及一些BUG.提高了浏览速度 <2&」· ASP 代码 · 共 38 行

ASP
38
字号
<!--#include file=../include/config.asp-->
<!--#include file=../include/conn_view.asp-->
<!--#include file=../include/function.asp-->
<%
	dim user,password,strSql,rsTmp,retValue
	user=request("user")
	password=request("password")
	if user="" then
		out("用户名不能为空!")
		resonse.end
	end if
	if password="" then
		out("密码不能为空!")
		resonse.end
	end if
	set rsTmp=Server.CreateObject("ADODB.RecordSet")
	strSql = "select * from [admin] where username='" & convertsql(user) & "'"
	strSql = strSql & " and userpassword='" & convertsql(password) & "'"
	rsTmp.open strSql,conn
	if rsTmp.eof then
		out("该用户不存在,或密码错误!")
		retValue=1
	else
		retValue=0
		'##设置session
		session("adminlogin")="ok"
		session("user_id")=rsTmp("user_id")
	end if
	rsTmp.close
	set rsTmp=nothing
	conn.close
	set conn=nothing
	'##跳转到另一页去
	if retValue=0 then
		response.redirect "../manage.asp"
	end if
%>
<!--#include file=../include/foot.asp-->

⌨️ 快捷键说明

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