echklogin.asp

来自「JSP ACCESS版的论坛源码 深圳盈盈通」· ASP 代码 · 共 50 行

ASP
50 行
字号
<% option explicit%>
<!--#include file="conn.asp"-->
<!-- #include file="inc/char.asp" -->
<%
   	dim sql,rs
	dim asql,ars
   	dim mastername
   	dim masterpass
   	dim founderr
   	founderr=false
   	dim boardID
	dim errmsg

   	'on error resume next
      	boardID=clng(request("Boardid"))
      	masterName=HTMLencode(trim(request("username")))
      	masterpass=HTMLencode(trim(request("password")))

	if masterName="" then
		Errmsg=Errmsg+"<br>"+"<li>请输入管理员名称。"
		founderr=true
	end if
	if masterpass="" then
		Errmsg=Errmsg+"<br>"+"<li>请输入管理员密码。"
		founderr=true
	end if
	if founderr=true then
		call error()
	else
	set ars=server.createobject("adodb.recordset")
	asql="select * from admin where password='"&masterpass&"' and username='"&masterName&"' and flag=1"
	ars.open asql,conn,1,1
 	if not(ars.bof and ars.eof) then
 		if masterpass=ars("password") then
	  		session("masterlogin")="superadmin"
	  		session("mastername")=ars("username")
          		session("manageboard")=boardID
			Response.Redirect "admin_main.asp"
   			ars.close
			set ars=nothing
			conn.close
			set conn=nothing
 		else
			call boardmaster()
			if founderr=true then call error()
 		end if
	end if
	end if
%>

⌨️ 快捷键说明

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