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

📄 logon.asp

📁 FLASH日记本 FLASH日记本
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!-- #include file="conn.asp" -->
<!-- #include file="../sql.asp" -->
<!-- #include file="md5.asp" -->
<%
'点击自动登录
auto=Request("auto")
'退出登录
unlogon=cstr(Request("unlogon"))
if unlogon="0" then
    '退出
	session("HYname")=""
	session("type")=""
	session("HYpwd")=""
	Response.Write("unlogon=1&")
	Response.Write("logonIn=0")
    Response.End()
end if

HY=trim(Request("HYname"))
HYpwd=md5(trim(Request("HYpwd")))

'if HY="" or HYpwd="" then
  'if session("HYname")<>"" and session("HYpwd")<>"" then '防止点击退出后按刷新重新载入Cookies
  	'HY=session("HYname")
  	'HYpwd=session("HYpwd")
    'if auto="" then
      'auto=1
    'end if
  'else
  	'Response.Write("unlogon=1&")
	'Response.Write("logonIn=0")
    'Response.End()
  'end if
'end if

  '登录
    set rs=server.CreateObject("ADODB.Recordset")
    SQL="select * from HuiYuan where HYname='"&HY&"' and HYpwd='"&HYpwd&"'"
    rs.open SQL,conn,2,3
      if not rs.eof then
	    set rsDiary=server.CreateObject("ADODB.RecordSet")
		rsDiarySQL="select * from Diary where HYname='"&HY&"'"
		rsDiary.open rsDiarySQL,conn,1,1		
        
		'发送变量到flash
		Response.Write("id="&rs("id")&"&")
		Response.Write("HYname="&rs("HYname")&"&")'会员名
		'Response.Write("HYpwd="&rs("HYpwd")&"&")'密码
        Response.Write("HYlogondate="&rs("HYlogondate")&"&") '上次访问时间		
		Response.Write("HYvisitCount="&rs("HYvisitCount")&"&")'已访问站点次数

		diaryCount=rsDiary.Recordcount
		if diaryCount="0" then		
		  Response.Write("diary_counter=你还没有写日记!&")'日记本总数
		else
		  Response.Write("diary_counter="&diaryCount&"&")'日记本总数
		end if
		Response.Write("HYquanXian="&rs("HYquanXian")&"&")'是否管理员
				
		rs("HYlogondate")=now() '最后一次登录时间更新	
		rs("HYvisitCount")=rs("HYvisitCount")+1 '已访问站点次数更新	
	    rs.update				
		
		'写入session
		session("HYname")=HY
		if rs("HYquanXian") = 1 then 
		  session("type")="1"
		else
		  session("type")="0"
		end if
		session("HYpwd") = HYpwd
		'写入cookies		
		'Response.Cookies("HYnameCookies")=rs("HYname")
		'Response.Cookies("HYpwd")=rs("HYpwd")
		
		
    	rs.close
		
		rsDiary.close
        set rsDiary=Nothing	
		Response.Write("logonIn=1&")'登录成功
        Response.End()
      else
	    '用户名和密码错误
	    Response.Write("logonIn=0&")
      end if
  rs.close
  set rs=Nothing
  CloseDataConn
%>



⌨️ 快捷键说明

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