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

📄 admin_login.asp

📁 基于asp的网站管理系统,课直接下载使用,对初学者有恨大帮助,希望对大家有用
💻 ASP
字号:
<!--#include file="include/conn.asp"-->
<html>
<head>
<title><%
set rs=server.createobject("adodb.recordset") 
sql="select top 1 classname from system order by id desc"
rs.open sql,db,1,1
%>
<%=rs("classname")%>
<% rs.close %></title>
<link rel=stylesheet href='include/class.css' type=text/css>
<script language=javascript>
	function CheckForm()
	{
		if(document.UserLogin.user.value=="")
		{
			alert("请输入用户名!");
			document.UserLogin.user.focus();
			return false;
		}
		if(document.UserLogin.pass.value == "")
		{
			alert("请输入密码!");
			document.UserLogin.pass.focus();
			return false;
		}
	}	
</script>
</head>
<body bgcolor="#6699cc" text="#000000" leftmargin="0" topmargin="5" marginwidth="0" marginheight="0">
<table width="780" cellpadding="0" cellspacing="0" border="0" align="center">
<tr valign="top">
    <td><img src="images/header.gif" width="780" height="20" border="0" alt=""></td>
</tr>
</table>

<table width="780" cellpadding="0" cellspacing="0" border="0" align="center">
<tr valign="top">
    <td><img src="images/splash-top.gif" width="780" height="15" border="0" alt=""></td>
</tr>
</table>

<!-- header -->
<table width="780" cellpadding="0" cellspacing="0" border="0" align="center">
<tr valign="top">
    <td width="18" height="72" background="images/splash-left.gif"></td>
    <td width="745" height="72" bgcolor="#99CCFF">
   <table width="100%" cellspacing="0" cellpadding="0" border="0" background="images/sidebox_bg.gif" height="72" align="center">
<tr><td align="left">
<font size="+2" face="华文行楷" color="#6699cc">&nbsp;&nbsp;<%
set rs=server.createobject("adodb.recordset") 
sql="select top 1 classname from system order by id desc"
rs.open sql,db,1,1
%>
<%=rs("classname")%>班级主页
<% rs.close %></font></td></tr></table>
   </td>
    <td width="17" height="72" background="images/splash-right.gif"></td>
</tr>
</table>

<table width="780" cellpadding="0" cellspacing="0" border="0" align="center">
<tr valign="top">
    <td><img src="images/splash-bottom.gif" width="780" height="7" border="0" alt=""></td>
</tr>
</table>

<table width="780" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr> 
    <td bgcolor="#0072BC" width="5"><img width="5" height="25"></td>
    <td bgcolor="#000000" width="1"><img width="1" height="1"></td>
    <td bgcolor="#99CCFF" width="1"><img width="1" height="1"></td>
    <td bgcolor="#6699CC" width="9"><img width="9" height="1"></td>
    <td bgcolor="#6699CC" align="left">当前位置: <a href="admin_login.asp">管理登陆</a></td>
    <td bgcolor="#6699CC" align="right">
<% if request.cookies("user")("username")="" then %>
<form action="login.asp?action=chk" method="post" name="UserLogin" style="margin:0" onSubmit='return CheckForm();'>
昵称:<input type="text" size="14" maxlength="20" name="user" value="">
&nbsp;&nbsp;密码:<input type="password" size="14" maxlength="20" name="pass" value="">
&nbsp;&nbsp;<input type="submit" value="登录" name="submit">&nbsp;<input name='Reset' type='reset' id='Reset' value='重填'>&nbsp;&nbsp;<a href='reg.asp' target='_blank'>新用户注册</a>&nbsp;&nbsp;<a href='login.asp?action=nopass' target='_blank'>忘记密码</a>
</form>
<% end if %>
<% if request.cookies("user")("username")<>"" and request.cookies("user")("password")<>""then %>
<%
dim user,pass
user=request.cookies("user")("username")
pass=request.cookies("user")("password")
set rs=server.createobject("adodb.recordset")
sql="select * from user where user='"&user&"' and pass='"&pass&"'"
rs.open sql,db,1,1
%>
<font color=red><%=rs("realname")%></font>,欢迎你登录!&nbsp;&nbsp;<a href='user.asp'>查看我的资料</a>&nbsp;&nbsp;
<%
set rs=server.createobject("adodb.recordset")
sql="select * from message where to='"&user&"' and isread='否'"
rs.open sql,db,1,1
%>
<% 
if rs.recordcount>0 then
   response.write "<a href='message.asp'><font color=red>您有新的消息</font></a><bgsound src=images/message.wav>"
      else
   response.write "<a href='message.asp'>查看历史消息</a>"
   end if
%>
<% rs.close %>
&nbsp;&nbsp;<a href='login.asp?action=out'>退出登录</a>
<% rs.close %>
<% end if %>
</td>
    <td bgcolor="#6699CC" width="9"><img width="9" height="1"></td>
    <td bgcolor="#336699" width="1"><img width="1" height="1"></td>
    <td bgcolor="#000000" width="1"><img width="1" height="1"></td>
    <td bgcolor="#0072BC" width="5"><img width="5"></td>
  </tr>
</table>
<table width="780" cellpadding="0" cellspacing="0" border="0" align="center">
<tr valign="top">
<td><img src="images/column-topper.gif" width="780" height="6" border="0" alt=""></td>
</tr>
</table>
<table width="780" cellpadding="0" cellspacing="0" border="0" bgcolor="#0072BC" align="center">
<tr valign="top">
<td><img width="5" height="1" border="0" alt=""></td>
<!-- left -->
<td bgcolor="#6699CC" background="images/column-bg.gif" width="150" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="150">
<tr>
<td align="left" width="150" height="10"><img src="images/sidebox-title-top.gif" width="150" height="10" alt=""></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="150">
<tr>
<td align="left" width="5" background="images/sidebox-title-left.gif"><img src="images/sidebox-title-left.gif" width="5" height="16" alt=""></td>
<td align="center" background="images/title-bg.gif" bgcolor="#99CCFF" width="140"><font color="#363636"><b>※班级向导※</b></font></td>
<td align="left" width="5" background="images/sidebox-title-right.gif"><img src="images/sidebox-title-right.gif" width="5" height="16" alt=""></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="150">
<tr>
<td align="left" width="150" height="7"><img src="images/sidebox-title-bottom.gif" width="150" height="7" alt=""></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="150">
<tr valign="top">
<td align="left" width="4" background="images/sidebox-content-left.gif"><img src="images/sidebox-content-left.gif" width="4" height="1" alt=""></td>
<td width="142" bgcolor="#99CCFF">
<table border="0" cellpadding="4" cellspacing="0" width="100%">
<TR><TD>· <a href="index.asp">返回首页</a> <br>
· <a href="intro.asp">班级介绍</a> <br>
· <a href="news.asp">班级动态</a> <br>
· <a href="photo.asp">班级相册</a> <br>
· <a href="txl.asp">通 讯 录</a> <br>
· <a href="gbook.asp">留 言 本</a> <br>
· <a href="user.asp">我的资料</a> <br>
· <a href="reg.asp">成员注册</a> <br>
· <a href="help.asp">帮助中心</a> <br>
<br>
· <a href="admin_login.asp?action=login">管理维护</a><br>
</TD></TR></TABLE></td>
<td align="left" width="4" background="images/sidebox-content-right.gif"><img src="images/sidebox-content-right.gif" width="4" height="1" alt=""></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="150">
<tr>
<td align="left" width="150" height="9"><img src="images/sidebox-bottom.gif" width="150" height="9" alt=""></td>
</tr>
</table>

</td>
<td width="100%"><table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" width="4" height="10"><img src="images/a1.gif" width="4" height="10" alt=""></td>
<td height="10" background="images/a2.gif"><img height="10"></td>
<td align="right" width="4" height="10"><img src="images/a3.gif" width="4" height="10" alt=""></td>
</tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" bgcolor="#99CCFF" width="100%">
<tr>
<td align="left" width="5" background="images/sidebox-title-left.gif"><img src="images/sidebox-title-left.gif" width="5" height="16" alt=""></td>
<td width="100%" background="images/title-bg.gif" align="center"><font color="#363636"><a href="admin_login.asp?action=login"><b>※ 管理员登陆 ※</b></a></font></td>
<td align="left" width="5" background="images/sidebox-title-right.gif"><img src="images/sidebox-title-right.gif" width="5" height="16" alt=""></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" width="4" height="7"><img src="images/b1.gif" width="4" height="7" alt=""></td>
<td height="7" background="images/b2.gif"><img  height="7"></td>
<td align="right" width="4" height="7"><img src="images/b3.gif" width="4" height="7" alt=""></td>
</tr>
</table>

<table border="0" cellpadding="0" cellspacing="0" bgcolor="#99CCFF" width="100%" height="225">
<tr>
<td align="left" width="4" background="images/sidebox-content-left.gif"><img src="images/sidebox-content-left.gif" width="4" height="1" alt=""></td>
<td bgcolor="#99CCFF" valign='top'>
<% if request("action")="" then %>
<Center><font color=red size=2><br><br>请勿手动修改URL数据!谢谢合作!</font></center>
<% end if %>
<% if session("admin")="" then %>
   <% if request("action")="login" then %>
    <br><br>
     <table width="308" border="0" align="center" cellpadding="0" cellspacing="0" class="box">
  <form name="form1" method="post" name="UserLogin" action="admin_login.asp?action=chk">
    <tr>
      <td height="16" align="center">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td width="101" height="25" align="center">管理员:</td>
      <td width="205">
        <input type="text" name="user">
      </td>
    </tr>
    <tr>
      <td height="25" align="center">密&nbsp;&nbsp;码:</td>
      <td><input type="password" name="pass"></td>
    </tr>
    <tr>
      <td height="40" colspan="2" align="center"><input name="reset" type="reset" value=" 重置 ">
&nbsp;
        <input name="Submit" type="submit" value=" 登录 "></td>
    </tr>
  </form>
</table>
<% end if %>
<% if request("action")="chk" then %>
<%
on error resume next
user=trim(request.form("user"))
pass=trim(request.form("pass"))
if instr(user,"&")>0 or instr(user,"=")>0 then
	response.write "<font color=red><center>用户名称包含非法字符!</center></font>"
	response.end
end if
if instr(pass,"&")>0 or instr(pass,"=")>0 then
	response.write "<font color=red><center>密码包含非法字符!</center></font>"
	response.end
end if
if user="" or pass=""  then
	response.write "<font color=red><center>用户名称和密码不能为空</center></font>"
	response.end
end if

set rs=server.createobject("adodb.recordset")
dim red
    sql="select * from admin where a_n='"&user&"' and a_p='"&pass&"'"
    set rs=db.execute(sql)
    if rs.eof and rs.bof then
      red="<br><br><br><center>您输入的 <font color=red>用户名称</font> 和 <font color=red>登陆密码</font>  有错误!<br>"&"请重新输入以并继续登陆本站!<br><a href=admin_login.asp?action=login>返回重新登录</a></center>"
      response.write red
    else
      session("admin")=rs("a_n")
      session("realname")=rs("realname")
	response.redirect "admin_index.asp"
      end if

%>
<% end if %>
<% end if %>

<% if session("admin")<>"" then %>
<% if request("action")="login" then %>
<center><br><br><br><font color=red>你已经登陆了!</font><br><br><a href='admin_index.asp'>点击进入管理后台</a></center>
<% end if %>
<% if request("action")="out" then
      session("admin")=""
      session("realname")=""
      response.write"<Center><font color=red size=2><br><br>你已经成功退出管理!欢迎你再次登陆!</font></center>"
end if
 %>
<% end if %>




</td>
<td align="left" width="4" background="images/sidebox-content-right.gif"><img src="images/sidebox-content-right.gif" width="4" height="1" alt=""></td>
</tr>
</table>
</td>

<table width="780" cellpadding="0" cellspacing="0" border="0" align="center">
<tr valign="top">
<td><img src="images/column-footer.gif" width="780" height="16" border="0" alt=""></td>
</tr>
</table>


<table width="780" cellpadding="0" cellspacing="0" border="0" align="center">
<tr valign="top">
<td><img src="images/footer.gif" width="780" height="20" border="0" alt=""></td>
</tr>
</table>

<!-- footer -->
<table width="780" cellpadding="0" cellspacing="0" border="0" align="center">
<tr align="center">
<td width="100%" colspan="3">版权所有:南昌大学02级精细有机<br>
Copyright 2004-2005 LionWick All Rights reserved. Powered by LionWick
</td>
</tr>
</table>

</body>
</html>

⌨️ 快捷键说明

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