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

📄 login.asp

📁 该资料包含大量网络开发的案例和源代码
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../include/functionjs.asp"-->
<!--#include file="../include/functionvb.asp" -->
<!--#include file="../include/md5.asp" -->
<!--#include file="../include/dbconn.inc" -->
<!--#include file="../include/refresh.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>56blog登录</title>
<link href="../include/main.css" rel="stylesheet" type="text/css">
<link href="../include/css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style2 {color: #CCCCCC}
-->
</style>
</head>

<body>
<div id="Layer1" style="position:absolute; width:794px; height:448px; z-index:1; left: 150px; top: 52px; background-color: #212021; layer-background-color: #212021; border: 1px none #000000;">
  <div id="Layer2" style="position:absolute; width:228px; height:361px; z-index:1; left: 27px; top: 52px;">
	<%
	if Request.QueryString("action")="logout" then
		if not request.Cookies("userinfo")("username")=empty then
			strSQL="select user_isonline,user_lastvistime,user_lastvistimetemp from user_info where user_id="& request.Cookies("UserInfo")("userid")&""
			objrs.open strsql,objconn,1,3
			objRS("user_isonline")=0
			objRS("user_lastvistime")=objRS("user_lastvistimetemp")
			objrs.update
			objrs.close
			Response.Cookies("UserInfo")("userid")=""
			Response.Cookies("UserInfo")("userName")=""
		end if
		log_title="<span class=style2>您已成功退出</span>"
		log_msg="<span class=style2>3秒后浏览器将自动跳转,<br> <br><a href='javascript:history.go(-1)'>如无跳转请手动点击这里</span></a><meta http-equiv='refresh' content=3;url='javascript:history.go(-1)'>"	
		response.Write(log_title & "<br><br>" & log_msg)
	elseif request.QueryString("action")="login" then
		dim log_title,log_msg
		dim userid,username,userpsw,logintype
		username=trim(request.form("name"))
		userpsw=trim(request.form("psw"))
		if DateDiff("s",Session("LogFailTime"),Now())>10 and Session("LogFailTime")<>Empty Then
			Session("LogFailCount")=0
		End If
		if username=empty or userpsw=empty then
			log_title="<span class=style2>错误信息"
			log_msg="<span class=style2>请将登录信息填写完整<meta http-equiv='refresh' content=3;url='javascript:history.go(-1)'>"
		elseif Session("LogFaiCount")>3 then
			Session("LogFailTime")=Now()
			log_title="<span class=style2>错误信息</span>"
			log_msg="<span class=style2>您已经三次登录错误,请等60秒后重新登录</span><meta http-equiv='refresh' content=3;url='javascript:history.go(-1)'>"
		else
			strSQL="select User_Id,User_Name,User_Psw from user_info where User_Name='"& Username &"' and User_Psw='"& md5(userpsw)&"'" 	
			set objrs=objConn.execute(strSql)
			if objRS.bof and objRs.eof then
				Session("LogFailTime")=Now()
				Session("LogFailCount")=Session("LogFailCount")+1		
				log_title="<span class=style2>错误信息</span>"
				log_msg="<span class=style2>无此用户或密码错误<meta http-equiv='refresh' content=3;url='javascript:history.go(-1)'></span>"				
			else
				if request("logintype")="blog" then
					logintype="../blog/main.asp"
				else
					logintype="../bbs/bbs_main.asp"
				end if
				strSQL="update user_info set User_IP='"& request.ServerVariables("REMOTE_ADDR") &"',user_LastVisTime='"&Now() &"' where user_Name='"& objRS("user_name")&"'"
				objConn.Execute(strSQL)
				Response.Cookies("UserInfo")("userId")=objRS("user_Id")
				Response.Cookies("UserInfo")("userName")=objRS("user_Name")
				Select Case Request.Form("CookieTime")
					Case "oneday"
						Response.Cookies("UserInfo").Expires=Date+1
					Case "onemonth"
						Response.Cookies("UserInfo").Expires=Date+31
					Case "oneyear"
						Response.Cookies("UserInfo").Expires=Date+365
				End Select
				objrs.close
				
				strSQL="select * from user_info where user_name='"& username &"'"
				objrs.open strsql,objconn,1,3
				userid=objrs("user_id")
				objrs("user_logincount")=objrs("user_logincount")+1
				objrs("user_lastvistimetemp")=now()
				objrs("user_isonline")=1
				objrs.update
				objrs.close
				
				strSQL="select * from webcount"
				objrs.open strsql,objconn,1,3
				objrs("Vis_TtlCnt")=objrs("Vis_TtlCnt")+1
				objrs("Vis_TdyCnt")=objrs("Vis_TdyCnt")+1
				objrs("Last_visUserId")=userid
				objrs("Last_visUsername")=username					
				objrs("Last_vistime")=now()
				objrs.update
				
				log_title="<span class=style2>登录成功</span>"
				log_msg="<span class=style2>3秒后浏览器将自动跳转,<br> <br><a href='"&logintype&"'>如无跳转请手动点击这里</a><meta http-equiv='refresh' content=3;url='"&logintype&"'></span>"%>	
					  	
			<!--#include file ="../include/endconn.inc"-->
			<%end if
		end if
		response.Write(log_title & "<br><br>" & log_msg)		
	else%>
	<form method="post" action="login.asp?action=login" >     
	<table width="100%" height="60%"  border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><span class="style2">用户:</span></td>
        <td><input name="name" type="text" id="name" size=12 maxlength="12"></td>
        </tr>
      <tr>
        <td><span class="style2">密码:</span></td>
        <td><input name="psw" type="password" id="psw"size=12></td>
      </tr>
      <tr>
        <td><span class="style2">Cookie保留时间:</span></td>
        <td><span class="style2">
          <select name="cookietime">
            <option value="nosave" selected>不保留</option>
            <option value="oneday">一天</option>
            <option value="onemonth">一个月</option>
            <option value="oneyear">一年</option>
          </select>
        </span></td>
      </tr>
      <tr>
        <td><span class="style2">登录方式:</span></td>
        <td><input type="radio" name="logintype" value="blog" checked="true">
          <span class="style2">blog</span>
          <input type="radio" name="logintype" value="bbs">
          <span class="style2">          bbs</span></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td><input type="submit" name="Submit" class="input"value="确认" rec></td>
        <td><input type="reset" name="resett" class="input"value="取消"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
	</form>
	<%
	end if%>
  </div>
  <div id="Layer3" style="position:absolute; width:200px; height:115px; z-index:2; left: 288px; top: 50px;"><img src="../resource/images/yellow.jpg" width="481" height="360"></div>
	<map name="Map">
    	<area shape="rect" coords="8,4,26,13"  title="回到主页" href="../blog/main.asp">
		<area shape="rect" coords="38,4,45,12"title="回到前一页" href="javascript:history.go(-1)">
	</map>  <img src="../resource/images/back.gif" width="59" height="17" border="0" usemap="#Map" align="top">
  </div>
</body>
</html>

⌨️ 快捷键说明

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