📄 admin_login.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<% option explicit %>
<!--#include file="md5.asp"-->
<%
If Request("action") = "login" Then
Dim objXML,loadResult
Dim userNameNode, passwordNode
Set objXML = server.CreateObject("Msxml2.DOMDocument")
loadResult = objXML.Load(server.MapPath("config.xml"))
If Not loadResult Then
Response.Write ("加载config.xml文件出错。")
Response.end
End If
Set userNameNode = objXML.getElementsByTagName("用户名")
Set passwordNode = objXML.getElementsByTagName("密码")
If md5(Request("text1")) <> userNameNode.item(0).Text Then
Response.Write ("<strong><font color=""#FF0000"">用户名错误</strong></font>")
Else
If md5(Request("text2")) <> passwordNode.item(0).Text Then
Response.Write ("<strong><font color=""#FF0000"">密码错误</strong></font>")
Else
Response.Cookies("isAdmin") = "yes"
Response.Redirect ("admin.asp")
'response.Write("登陆成功")
Response.End
End If
End If
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理员登录</title>
<style type="text/css">
body,tr,td {
text-align: center;
font-family: 宋体;
font-size: 13px
}
</style>
<script language="JavaScript">
function checkInput(){
if (document.form1.text1.value==""){
alert("请输入用户名");
document.form1.text1.focus();
return false;
}else if(document.form1.text2.value==""){
alert("请输入密码")
document.form1.text2.focus();
return false;
}else{
return true;
}
}
</script>
</head>
<body bgcolor="#FFF9EE">
<table width="650" border="0" bgcolor="#003399" cellpadding="3" cellspacing="1" align="center">
<tr>
<td height="20" background="images/topbg.gif"></td>
</tr>
<tr bgcolor="#7DA4EC">
<td height="20"><font color="#FFFFFF"><strong>管理员登录 ━━ 安徽省淮南市公交车查询系统</strong></font></td>
</tr>
<tr bgcolor="#E8F3FF">
<td height="71">
<form action="admin_login.asp" method="post" name="form1" onSubmit="return checkInput();" target="_self">
<input type="hidden" name="action" value="login">
<table width="300" border="0" bgcolor="#003399" cellpadding="3" cellspacing="1" align="center">
<tr bgcolor="#7DA4EC">
<td colspan="2"><div align="center"><strong><font color="#FFFFFF">管理员登录</font></strong></div></td>
</tr>
<tr bgcolor="#E8F3FF">
<td width="84"><strong>用户名</strong></td>
<td width="201"><input type="text" name="text1" style="width:150px"></td>
</tr>
<tr bgcolor="#E8F3FF">
<td><strong>密 码</strong></td>
<td><input type="password" name="text2" style="width:150px"></td>
</tr>
<tr bgcolor="#E8F3FF">
<td colspan="2"><div align="center"></div>
<div align="center">
<input type="submit" name="Submit" value="登 录">
<input type="reset" name="Submit2" value="重 置">
</div></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td height="20" background="images/bottombg.gif"></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -