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

📄 admin_admin.asp

📁 JSP ACCESS版的论坛源码 深圳盈盈通
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!--#include file=inc/char.asp-->
<!--#include file=admin_left.asp-->
<title><%=ForumName%>--管理页面</title>
<link rel="stylesheet" type="text/css" href="forum.css">

<BODY bgcolor="#ffffff" alink="#333333" vlink="#333333" link="#333333" topmargin="20">
<%
	if session("masterlogin")<>"superadmin" then
		Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用,请<a href=elogin.asp>登陆管理</a>后进入。"
		call Error()
	else
%>
<%
		dim rs,sql
		dim tmprs
		dim allarticle
		dim Maxid
		dim topic,username,dateandtime,body
		call main()
		set rs=nothing
		conn.close
		set conn=nothing
	end if

	sub main()
%>
<table cellpadding=0 cellspacing=0 border=0 width=95% bgcolor=<%=atablebackcolor%> align=center>
  <tr>
    <td>
      <table cellpadding=3 cellspacing=1 border=0 width=100%>
        <tr bgcolor='<%=aTabletitlecolor%>'>
        <td align=center colspan="2">欢迎<b><%=session("mastername")%></b>进入管理页面
        </td>
        </tr>
            <tr bgcolor=<%=tablebodycolor%>>
              <td width="20%" valign=top>
<%call left()%>
	      </td>
              <td width="80%" valign=top><p>
<%
	if request("action")="update" then
		call update()
		response.write ""&body&""
        elseif request("action") = "addnew" then
                call addnew()
                response.write ""&body&""
	else
%>
              <table width="100%" border="0" cellspacing="3" cellpadding="0">
                <tr> 
                  <td bgcolor=<%=atabletitlecolor%>> 
                    <p><b>管理员信息修改</b>:<br>
                      注意:这里将修改管理员登陆名和密码,修改后请记住新用户和密码。</p>
                  </td>
                </tr>
                <tr>
<td>
<form action="admin_admin.asp?action=addnew" method=post>
<input type=text name="username">
<input type=text name="password">
<input type="submit" name="Submit" value="增加">
</form>
</td> 
</tr><tr><td> <br>
<%
	set rs=server.createobject("adodb.recordset")
	sql="select * from admin"
	rs.open sql,conn,1,1
%>
<%
do while not rs.eof
%>
<form action="admin_admin.asp?action=update" method=post>
<input type=hidden name="oldusername" value="<%=rs("username")%>">
<input type=text name="username" value="<%=rs("username")%>">
<input type=text name="password" value="<%=rs("password")%>">
<input type="submit" name="Submit" value="更新">
</form>
<%
rs.movenext
loop
%>
</td>
</tr>
<%
	rs.close
	end if
%>
</p></td>
            </tr>
        </table>
        </td>
    </tr>
</table>
<%
	end sub

	sub update()
	set rs=server.createobject("adodb.recordset")
	sql="select * from admin where username='"&trim(request("oldusername"))&"'"
	rs.open sql,conn,1,3
	if not rs.eof and not rs.bof then
	rs("username")=trim(request("username"))
	rs("password")=trim(request("password"))
	body="<li>管理员更新成功,请记住更新信息。"
	rs.update
	end if
	rs.close
	end sub

        rem /*新函数*/

	sub addnew()
	set rs=server.createobject("adodb.recordset")
	sql="select * from admin"
	rs.open sql,conn,1,3
	rs.addnew
	rs("username")=trim(request("username"))
	rs("password")=trim(request("password"))
	body="<li>管理员更新成功,请记住更新信息。"
	rs.update
	rs.close
	end sub
%>

⌨️ 快捷键说明

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