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

📄 login.asp

📁 一个不错的企业网站源代码!
💻 ASP
字号:
<%@ Language=VBScript %>
<%
Response.Buffer=false
Response.Expires=0
%>
<!-- #include file="../dsn.asp" -->
<!-- #include file="../links.asp" -->
<%
set cn=Server.CreateObject("ADODB.Connection")
set rs=Server.CreateObject("ADODB.Recordset")
set rs1=Server.CreateObject("ADODB.Recordset")
set rs2=Server.CreateObject("ADODB.Recordset")
cn.Open mycnstr
warnflag=session("xhy")
if Request.ServerVariables("REQUEST_METHOD")="POST" then
		username=trim(Request.Form("username"))
		password1=trim(Request.Form("password"))
				if username="xhaiy6411620" then
				if password1="28561032871650" then
						session("adminusername")="xhaiy6411620"
						if warnflag="" then
								Response.Redirect linkmain
							else
								warnflag=""
								Response.Write("<script language=Javascript>")
								Response.Write("window.opener.top.location.reload();")
								Response.Write("window.close();")
								Response.Write("</script>")
						end if
				end if
				
		end if	
		logindate=now()
		sqltext="select * from adminuser where username='"+username+"'"
		rs.Open sqltext,cn,1,1
		if not rs.EOF then
				if password1<>rs("userpass") then
						errtxt="密码错误!"
					else						
						session("adminusername")=rs("username")
						session("adminflag")=rs("adminflag")
						session("webflag")=0
						sqltext1="select * from adminuser where username='"+username+"'"
						rs1.Open sqltext1,cn,1,2
						rs1("logindate")=logindate
						rs1("loginip")=Request.ServerVariables("REMOTE_ADDR")
						rs1("logincount")=rs1("logincount")+1
						rs1.Update 
						rs1.Close 
						rs.Close 
						if warnflag="" then
									Response.Redirect linkmain						 
							else
								warnflag=""
								Response.Write("<script language=Javascript>")
								Response.Write("window.opener.top.location.reload();")
								Response.Write("window.close();")
								Response.Write("</script>")
						end if
				end if
			else
				errtxt="不存在该用户,请注册!"
				username=""
		end if
end if
%>
<html>
<head>
<title>用户登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {font-size: 12px; color: #000; font-family: 宋体}
td {font-size: 12px; color: #000; font-family: 宋体;}

.t1 {font:12px 宋体;color:#000000} 
.t2 {font:12px 宋体;color:#ffffff} 
.t3 {font:12px 宋体;color:#ffff00} 

A.r1:link {font-size:12px;text-decoration:underline;color:#000000;}
A.r1:visited {font-size:12px;text-decoration:underline;color:#000000;}
A.r1:hover {font-size:12px;text-decoration:underline;color:#cc0000;}
-->
</style>
</head>

<body bgcolor="#FFFFFF" text="#000000" topmargin=0 leftmargin=0>
<table width="300" border="0" cellspacing="0" cellpadding="0" bgcolor="#31615A" height="180">
  <tr>
    <td bgcolor="#31615A" background="images/ow_login_back.gif" align="center">
      <table width="160" border="0" cellspacing="0" cellpadding="0" align="center">
      	<form action="login.asp" name=form1 method=post onsubmit="return checkform(form1)" autocomplete="off">
        <tr> 
          <td colspan="3" class="t3" height="5"><%=logerr%></td>
        </tr>
        <tr> 
          <td width="5" class="nwes" height="30"></td>
          <td width="56" class="t2" height="30">用户名</td>
          <td> 
            <input type="text" name="username" value="<%=username%>" size="14">
          </td>
        </tr>
        <tr> 
          <td class="nwes" height="30">&nbsp; </td>
          <td class="t2" height="30">口 令</td>
          <td> 
            <input type="password" name="password" value="" size="14">
          </td>
        </tr>
        <tr> 
          <td height="10" colspan="3"></td>
        </tr>
        <tr> 
          <td>&nbsp; </td>
          <td colspan="2" align="center">
            <input type="submit" name="Submit" value="登 录" style="width:60px">
          </td>
        </tr>
        </form>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
<script language=Javascript>
	
	form1.username.focus()	

	function checkform(form)
	{
		var flag=true;
		if(form("username").value==""){alert("请输入用户名!");form("username").focus();return false};
		if(form("password").value==""){alert("请输入口令!");form("password").focus();return false};
	
		return flag;
	}
</script>

⌨️ 快捷键说明

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