登陆账号密码均为 admin ,目前测试兼容IE5,其他浏览器会变形
ASP Acces演示后台登录程序:<!--#include file="conn.asp"-->
<html>
<head>
<title><%=sysname%> - 后台管理登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="STYLESHEET" type="text/css">
</head>
<body bgcolor="#FFFFCC" text="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5"></td>
</tr>
</table>
<%
Select Case request("action")
Case "login" :login()
Case Else
list()
End Select
Sub login
admin_name=Trim(Replace(request("admin_name"),"'",""))
admin_pass=Trim(Replace(request("admin_pass"),"'",""))
admin_dengji=Trim(Replace(request("admin_dengji"),"'",""))
If admin_name<>"" And admin_pass<>"" Then
Set rs=conn.execute("select * from [admin_admin] where a_name='"&admin_name&"' and a_pass='"&admin_pass&"'")
If rs.eof Then
response.write "<script>alert('用户名或密码错误!~!');window.document.location.href='default.asp';</script>"
response.End()
Else
session("admin_name")=admin_name
session("u_name")=""
session("admin_dengji")=rs("a_dengji")
session.Timeout=1000
response.redirect "manage.asp"
End If
rs.close
Else
response.redirect"default.asp"
response.End()
End If
End Sub
Sub list
response.write"<table cellspadding='1' cellspacing='1' width='300' align='center' border='0' bgcolor='#E1DEDB'>"&_
"<form method=post action=default.asp?action=login>"&_
" <tr><td height=25 align=center colspan=2 bgcolor='#4685CA'>管理员登陆</td></tr>"&_
" <tr><td width='20%'>用户名</td><td><input name=admin_name size=15 type=text></td></tr>"&_
" <tr><td width='20%'>密 码</td><td><input name=admin_pass size=15 type=password></td></tr>"&_
" <tr><td height=25 align=center colspan=2 bgcolor=#4685CA><input type=submit name=button value=登陆></td></tr>"&_
" </form></table>"
End Sub
%>
</body>
</html>
评论