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

📄 login.asp

📁 21世纪人才www.51zy.net 网站源码
💻 ASP
字号:
<!--#include file = "../Include/DBClass.inc.asp"-->
<!--#include file="../Include/MD5.asp" -->

<%
Dim Position, aAction, Errmsg, aUserID, aPassWD, aRePassWD, aHRePassWD, aLevel

Position = GetSafeInt(Trim(Request("Position")),0)

If Position < 1 Then
	Errmsg = ""
	Position = 1
Else
	Errmsg="<font color=#FF0000><b>您没有登陆或者停留的时间过长,请重新登陆!</b></font>"
End If

aAction = GetSafeStr(Request.Form("action"))
If aAction = "true" Then
	Dim Server_v1, Server_v2
   	Server_v1 = Cstr(Request.ServerVariables("HTTP_REFERER"))
   	Server_v2 = Cstr(Request.ServerVariables("SERVER_NAME"))
   	If Mid(Server_v1,8,Len(Server_v2)) <> Server_v2 Then '外部提交的数据
		Call OKToWhere("数据提交错误!")
		Response.End()
	Else
		aUserID = Trim(Request("a_userid"))
		aPassWD = Trim(Request("a_pwd"))
		aRePassWD = Trim(Request("a_rpwd"))
		aHRePassWD = Trim(Request("a_h_rpwd"))
	
		If aPassWD <> "" And aPassWD <> "" and aRePassWD <> "" Then
			If aRePassWD = aHRePassWD Then
				sSql = "SELECT * FROM Admin WHERE A_UserID ='"&aUserID&"'"
				oRs.Open sSql, oConn, 0, 1
				If Not oRs.Eof Then
					If oRs("A_PWD") = md5(aPassWD) Then
						' 登录成功
						aLevel = oRs("A_Level")
						Session("Sys_Admin") = aUserID
						Session("Sys_Level") = aLevel
					
						If Position = 2 Then
							Response.Write "<script language='JavaScript'>top.document.location.reload();</script>"
						Else
							Response.Redirect "Admin.asp"
							Response.End
						End If
					Else
						Errmsg = "提示:密码输入错误!"
					End If
				Else
					Errmsg = "提示:该用户名输入错误或者不存在!"
				End If
				oRs.Close
				Set oRs = Nothing
			Else 
				Errmsg = "提示:附加码输入错误!"
			End If
		Else
			Errmsg = "提示:用户名或、密码、附加码不能为空!"
		End If
	End If
End If
%>

<HTML>
<HEAD>
<TITLE><%=Homepage_Title%>--管理中心-用户登陆</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script language="JavaScript">
<!--
function window_onload() {
	document.mail.a_userid.focus();
}
function cancel()
{
	mail.reset();
}

function IsValid()
{
	if (document.mail.a_userid.value=="")
	{
		alert("用户名不能为空");
		document.mail.a_userid.focus();
		return false;
	}
	if (document.mail.a_pwd.value=="")
	{
		alert("密码不能为空");
		document.mail.a_pwd.focus();
		return false;
	}
	
	if (document.mail.a_rpwd.value=="")
	{
		alert("附加码不能为空");
		document.mail.a_rpwd.focus();
		return false;
	}
	return true;
}
//-->
</script>
<link rel="stylesheet" href="../Css/style.css" type="text/css">
</HEAD>

<BODY bgColor=#FFFFFF topMargin=0 leftmargin="0" onload="return window_onload()">
<p>&nbsp;</p>

<div align="center"><font color="#FF0000"><b><%=Errmsg%></b></font></div>
<table width="450" height="289" border="0" cellpadding="0" cellspacing="0" background="images/admin.gif" align="center">
  <form name=mail action="Login.asp" onSubmit="return IsValid();" method=post>
    <tr> 
      <td width="83" height="133">&nbsp;</td>
      <td width="283">&nbsp;</td>
      <td width="84">&nbsp;</td>
    </tr>
    <tr> 
      <td height="98">&nbsp;</td>
      <td valign="top"> 
        <table cellspacing=0 cellpadding=0 width=247 border=0 align="center">
          <tbody> 
          <tr> 
            <td height="28" style="line-height:180%"> 帐&nbsp;&nbsp;号: 
              <input name="a_userid" type="text" class="button1" id="a_userid" size="20">
            </td>
          </tr>
          <tr> 
            <td height="28" style="line-height:180%"> 密&nbsp;&nbsp;码: 
              <input name="a_pwd" type="password" class="button1" id="a_pwd" size="20">
            </td>
          </tr>
          <tr>
            <td height="28" style="line-height:180%"> 附加码: 
              <input name="a_rpwd" type="text" class="button1" id="a_rpwd" size="20">
              <font face="Arial, Helvetica, sans-serif"> 
              <%
				Dim Temprnd
				Randomize
				Temprnd=Cstr(Int((9999 - 1000 + 1) * Rnd() + 1000))
				Response.Write "<span style='background-color:#DFDFFF'><img src='Images/"& Mid (Temprnd,1,1) &".gif'><img src='Images/"& Mid (Temprnd,2,1) &".gif'><img src='Images/"& Mid (Temprnd,3,1) &".gif'><img src='Images/"& Mid (Temprnd,4,1) &".gif'></span>"
			  %>
              </font>
              <input type="hidden" name="action" value="true">
			  <input type="hidden" name="position" value="<%=Position%>">
			  <input type="hidden" name="a_h_rpwd" value="<%=Temprnd%>">
			  </td>
          </tr>
          </tbody> 
        </table>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr> 
      <td>&nbsp;</td>
      <td valign="top"> 
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td> 
              <div align="center"> <a href="/"><font color="#0000FF">返回首页</font></a> 
              </div>
            </td>
            <td> 
              <input type=image height=23 width=62 src="images/btn_index_ok.gif" border=0 name=submit1>
              <img onMouseOver="event.srcElement.style.cursor='hand'" onClick=cancel() height=23 src="images/btn_index_cancel.gif" width=62 border=0> </td>
          </tr>
        </table>
      </td>
      <td>&nbsp;</td>
    </tr>
  </form>
</table>
</BODY>
</HTML>

⌨️ 快捷键说明

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