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

📄 admin_login.asp

📁 本源代码为 网雷弹窗联盟程序的源代码,欢迎大家的下载,学习与交流
💻 ASP
字号:
<!--#include file="head.asp"-->
<%
if (Request("Submit")="进 入") then
	call LoginCheck
end if

sub LoginCheck
	if Trim(Request("MyName")) = "" or Trim(Request("MyPsw")) = "" then
		session("Errmsg") = "<li>请输入登陆用户名或密码。</li>"
		exit sub
	else
		UserName = checkStr(Request("MyName"))
		password = checkStr(Request("MyPsw"))
	end if
	
	IP = Request.ServerVariables("LOCAL_ADDR")

	Sql = "Select * from Admin where UserName='"& UserName &"'"
	Set Rs = Conn.execute(Sql)
	if Rs.eof and Rs.bof then
		Rs.close
		Set Rs = nothing
		session("Errmsg") = session("Errmsg")+"<li>您输入的用户名和密码不正确1。</li>"
		exit sub
	else
		if Trim(rs("password"))<>md5(password) then
	response.write Trim(rs("password"))
	response.write "<br>"
	response.write md5(password)
			session("Errmsg") = session("Errmsg")+"<li>您输入的用户名和密码不正确2。</li>"
			exit sub
		else
			Session("Adminflag")=rs("flag")
			Session("Admin_Name")=UserName

			session.timeout=45
			conn.execute("update Admin set LastLogin=Now(),LastLoginIP='"&IP&"' where UserName='"&UserName&"'")
			rs.close
			set rs=nothing
			response.write "<script>location.href='Admin_index.asp'</script>"
		end if
	end if
end sub
%>
<html>

<head>
<title>管理员登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
TD {
	FONT-SIZE: 12px; COLOR: #ffffff
}
.MyInput {
	BORDER-RIGHT: black 1pt solid; PADDING-RIGHT: 3pt; BORDER-TOP: black 1pt solid; PADDING-LEFT: 3pt; FONT-SIZE: 9pt; BACKGROUND: url(img/inputbg.gif); PADDING-BOTTOM: 1pt; BORDER-LEFT: black 1pt solid; PADDING-TOP: 1pt; BORDER-BOTTOM: black 1pt solid
}
.MySubmit {
	BORDER-TOP-WIDTH: 1pt; BORDER-LEFT-WIDTH: 1pt; FONT-SIZE: 9pt; BORDER-BOTTOM-WIDTH: 1pt; WIDTH: 50px; BORDER-RIGHT-WIDTH: 1pt
}
</style>
<script laugauge="javascript">
<!--
function PageOnLoad(){
	MaxWindow();
	document.MyAdmin.MyName.focus();
}

function AdminQuit(){
	window.close();
}

function MaxWindow(){
	window.moveTo(0,0);
	window.resizeTo(screen.Width,screen.Height-25);
}

function checkform(){ 
	var Checkblank = /^(\s*|(\ )|(\.))*$/;

	if (Checkblank.test(MyAdmin.MyName.value)){
 		alert("用户名不能为空!");
 		MyAdmin.MyName.focus();
  	return false; 
	} 
	if (Checkblank.test(MyAdmin.MyPsw.value)){
  	alert("密码不能为空!");
  	MyAdmin.MyPsw.focus();
  	return false; 
	} 
}
//-->
</script>
</head>

<body onMouseOver="window.status='欢迎来到<%=NetName%>!';return true" onLoad="PageOnLoad()">

<table height="100%" cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
	<tr>
		<td align="center" valign="middle">
		<form name="MyAdmin" action="Admin_login.asp" method="post" onSubmit="return checkform()" target="_top">
			<table width="500" height="300" border="0" align="center" cellpadding="0" cellspacing="2">
				<tr bgcolor="#ffffff">
					<td align="right" background="img/bg_dragon.jpg">
					  <table cellspacing="0" cellpadding="0" width="260" border="0">
              <tr>
                <td align="left" height="30">
								<%
								if session("Errmsg") <> "" then
									response.write session("Errmsg")
									session("Errmsg") = ""
								end if
								%></td>
              </tr>
            </table>
					  <table cellspacing="0" cellpadding="0" width="260" border="0">
						<tr>
							<td align="center" height="30"><strong>==管理员登录==&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </strong></td>
						</tr>
					</table>
					<table cellspacing="0" cellpadding="0" width="260" border="0">
						  <tr>
							  <td align="right" width="60" height="30">用户名:</td>
							  <td width="210" height="30">
							  <input name="MyName" class="MyInput" ></td>
						  </tr>
						  <tr>
							  <td align="right" width="60" height="30">密&nbsp; 码:</td>
							  <td width="140" height="30">
							  <input name="MyPsw" type="password" class="MyInput"></td>
						  </tr>
						  <tr>
							  <td width="60" height="30"> </td>
						    <td width="140" height="30">
							  <input class="MySubmit" type="submit" value="进 入" name="Submit">
							  <input class="MySubmit" type="button" value="退 出" name="quit" id="quit" onClick="AdminQuit()"></td>
						  </tr>
					  </table></td>
				</tr>
			</table>
		</form>
		</td>
	</tr>
</table>

</body>

</html>

⌨️ 快捷键说明

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