⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 entercheck.asp

📁 功能简介: 前台: 1.用户名注册:登 录 名:密码:确认密码:性别:查询权限: 地址: 联系电话: 移动电话: E - mail: 工作单位 2.系统优点管理,公告新闻管理,联系我们管理
💻 ASP
字号:

<!--#include file="conn.asp"-->
<%
dim admin_name,admin_pwd,type1,provinceid,cityid,areaid,id,users
admin_name=trim(request("name"))
admin_pwd=trim(request("pwd"))
type1=trim(request("states"))

if admin_name="" or admin_pwd="" then
response.write "<script>alert('对不起,用户名和密码不能为空!');window.history.back();</script>"
response.end
end if
set rs=server.createobject("adodb.recordset")

	sql="select * from regist where username='"&admin_name&"' and pwd='"&admin_pwd&"'"
	
		
	
rs.open sql,conn,1,1

if rs.eof then
	
		response.write "<script>alert('对不起,用户名或密码不正确,请重新输入');window.history.back();</script>"
		response.end
else
provinceid=rs("provinceid")
	cityid=rs("cityid")
	areaid=rs("areaid")
	id=rs("id")
	set rs1=server.createobject("adodb.recordset")

	sql="select * from regist where isadjust=1 and username='"&admin_name&"' and pwd='"&admin_pwd&"'"
	
    rs1.open sql,conn,1,1

	if rs1.eof then
		response.write "<script>alert('对不起,你还未通过审核,暂时还无法登录');window.history.back();</script>"
		response.end
	else
	set rs1=server.createobject("adodb.recordset")

	sql="select * from regist where isadjust=1 and username='"&admin_name&"' and pwd='"&admin_pwd&"' and (endtime>getdate() or endtime='') and (usernum>curnum or usernum=0)"
	
    rs1.open sql,conn,1,1
	
		if rs1.eof then
		response.write "<script>alert('对不起,该用户使用期限已到期!');window.history.back();</script>"
		response.end
	else
	
	
	
	users=application("users")
		if(users<>empty) then
			myArr=Split(users,",") 
			dim f
			f=0
			for i=0 to ubound(myArr)
	
		
		
			if trim(myArr(i))=admin_name then
				f=1
				exit for
			end if		
		
			next
			
			if f=0 then
			
			if(session("username")<>"") then
		
				
			dim username1,users1,users11
 username1=session("username")
 users1=application("users")
		if(users1<>empty) then
			myArr=Split(users1,",") 
			
			for i=0 to ubound(myArr)
				
				if trim(myArr(i))<>username1 then
					if(users11=empty) then
					users11=myArr(i)
					else
					users11=users11&","&myArr(i)
					end if
				end if		
		
			next
			
		
		
		end if
		application("users")=users11
			
			
		end if
		
			users=application("users")
			
			
			users=users&","&admin_name
			
			else
				response.write "<script>alert('已经有人在使用,请务非法登陆!');window.history.back();</script>"
				response.end
			end if
		else
			users=admin_name
		end if
		application("users")=users
		sql="select * from regist where isadjust=1 and username='"&admin_name&"' and usernum>0"
		
		set rs1=server.createobject("adodb.recordset")

	
    	rs1.open sql,conn,1,1
	
		if not rs1.eof then
		sql="update regist set curnum=curnum+1 where username='"&admin_name &"'"
		conn.Execute(sql)
		end if
		
		session("username")=admin_name
		session("provinceid")=provinceid
		session("cityid")=cityid
		session("areaid")=areaid
		session("id")=id
		response.redirect "show.asp"
		end if
	end if
end if
%>

⌨️ 快捷键说明

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