📄 adm_login.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file=conn.asp-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="css.css" type=text/css rel=stylesheet>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>管理登陆</title>
<style type="text/css">
<!--
.STYLE7 {font-size: 14px}
-->
</style>
</head>
<body>
<br />
<%
dim action,username,password
action=trim(request.QueryString("action"))
username=(request.Form("username"))
password=trim(request.Form("password"))
if action="submit" then
if username="" then
response.Write"<center><font color=red>用户名不能为空!</font><br>请<a href=adm_login.asp>重新登陆</a></center>"
response.End()
end if
if len(username)>10 then
response.Write"<center><font color=red>用户名不能大于十位!</font><br>请<a href=adm_login.asp>重新登陆</a></center>"
response.End()
end if
if len(password)>16 then
response.Write"<center><font color=red>密码不能大于十六位!</font><br>请<a href=adm_login.asp>重新登陆</a></center>"
response.End()
end if
if password="" then
response.Write"<center><font color=red>密码不能为空!</font><br>请<a href=adm_login.asp>重新登陆</a></center>"
response.End()
end if
set rs=server.createobject("adodb.recordset")
sql="select * from admins where susernames='"&username&"'"
rs.open sql,conn,1,1
if rs.eof or rs.bof then
response.Write"<center><font color=red>该用户不存在!请重新登陆!</font><br>请<div><a href=adm_login.asp>重新登陆</a><div></center>"
response.end
end if
if trim(rs("spasswords"))<>password then
response.write"<center><font color=red>密码错误!请重新登陆!</font><br>请<div><a href=adm_login.asp>重新登陆</a></div></center>"
response.end
end if
session("name")=username
session("islogin")=1
session("realname")=rs("realname")
rs.close:set rs=nothing
response.write"<center>登陆成功!</center>"
set rs=server.CreateObject("adodb.recordset")
sql="select top 1 * from log"
rs.open sql,conn,1,3
rs.addnew
rs("username")=session("name")
rs("realname")=session("realname")
rs("ip")=Request.ServerVariables("LOCAL_ADDR")
rs.update
rs.close
set rs=nothing
response.Redirect"log.asp"
else
%>
<div class="top"></div>
<div class="contain"></div>
<div class="left"></div>
<div class="right">
<FORM action="?action=submit" method="post" name="form1" target="_parent" id="form1" onsubmit="return checkform()">
<div id="line1"> <span class="login-text STYLE7">用户名</span>:
<input class="username" id="username" maxLength="20" size="15" name="username" /></div>
<div id="line2"><span class="login-text STYLE7">密 码</span>:
<input class="password" id="password" type="password" maxLength="30" size="15" name="password" /></div>
<div id="line3"><input type="image" height="26" width="82" src="images/denglu.gif" border="0" name="imageField" /></div>
</FORM>
</div>
<div class="bottom"></div>
<script language=javascript>
function checkform()
{
if (document.form1.username.value==""){
alert("请输入用户名?")
document.form1.username.focus();
return false
}
if (document.form1.password.value==""){
alert("请输入密码?");
document.form1.password.focus();
return false
}
return true
}
function reset_form()
{
document.form1.adminname.value="";
document.form1.adminpwd.value="";
document.form1.VerifyCode.value="";
document.form1.adminname.focus;
}
</script>
<%end if%>
<%
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -