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

📄 adminother.asp

📁 gdflsdf fkspofql owjlfkjsoijdf sdjfo
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="sub/config.asp"-->
<!--#include file="sub/conn.asp"-->
<!--#include file="sub/inc.asp"-->
<%
call hacker()
if session("admin")<>"axsj" then
response.Write "<script>alert('您还没有登陆!');this.location.href='index.asp';</script>"
Response.End
end if
call adminjj()
adminname=session("adminname")
adminsuper=session("adminsuper")
%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=Sitename%>-后台管理系统</title>
<link href="index.css" rel="stylesheet" type="text/css" />
</head>
<body <%if request("type")="edit" then%>onload="return ax();"<%end if%>>
<!--#include file="top.asp"-->
<table width="780" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr><td height="4" colspan="2" background="images/index_11.gif"></td>
  </tr>
  <tr>
    <td width="200" align="center" valign="top">
	<% '调用左边框架
	   call adminleft()%>
	      
    <p>&nbsp;</p>    </td>
    <td width="580" align="left" valign="top" bgcolor="#EDFFFF">

	
	 <%
if request("type")<>"edit" then	
action=request("action")
select case action
case "add"
call add()
case "del":
call del()
case "cng"
call cng()

end select

sub add()

set rs1=server.createobject("adodb.recordset")
sql1="select * from other"
rs1.open sql1,cn,3,3
rs1.addnew
rs1("title")=request.Form("title")
rs1("content")=request.Form("content")
rs1.update
response.Write"上一步操作:添加"&rs1("title")&"成功!"
rs1.close
set rs1=nothing
end sub

sub del()
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from other where id="&request("id")
rs1.open sql1,cn,1,3
rs1.delete
response.Write"上一步操作:删除成功!"
rs1.close
set rs1=nothing
end sub

sub cng()
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from other where id="&request("id")
rs1.open sql1,cn,1,3
rs1("title")=request.Form("title")
rs1("content")=request.Form("content")
rs1.update
response.Write"上一步操作:修改成功!"
rs1.close
set rs1=nothing
end sub
%>

      <table width="240" border="1" cellspacing="0" cellpadding="0">
      <tr>
        <td width="134" height="20" align="center" bgcolor="#3A82C4">底下导航名称</td>
        <td width="106" height="20" align="center" bgcolor="#3B83C5">选项</td>
      </tr>
	  
	     <% sqlstr ="select * from other order by id desc"   '查表
	set rs =cn.execute(sqlstr) '利用connection的execute方法运行SQL命令
	Do While (Not RS.Eof)
   %>
	  
      <tr>
        <td height="20" align="center"><%=rs("title")%></td>
        <td height="20" align="center"><a href="?type=edit&id=<%=rs("id")%>">修改</a></td>
      </tr>
	    	  <% 
   rs.movenext
   loop
   set rs =nothing
   else
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from other where id="&request("id")
rs1.open sql1,cn,1,2
%>
   <form action="?action=cng&id=<%=request("id")%>" method="post" name="form1" onSubmit="return chk();">
   &nbsp;&nbsp;频道标题:<input name="title" type="text" value="<%=rs1("title")%>" size="12" maxlength="40" class="wubian"/>数据载入比较慢,请耐心等待再修改!
   <%
   '这里调用了sub/inc.asp文件,这里是修改的功能,当然要先显示数据库里的content字段,我不知怎么弄
   call html()
   %>
   
   <input name="Submit2" type="submit" class="wubian" value="确认修改" />
   <textarea name="content" id="content" style=display:none><%=Server.HtmlEncode(rs1("content"))%></textarea>
   </form>
   <script language="javascript">
function ax(){
IframeID.document.body.innerHTML=document.all("content").value;
document.all("content").value="";
}
function chk(){
document.all("content").value=IframeID.document.body.innerHTML;
if(document.form1.title.value==""){
alert("频道标题不能为空");
document.form1.title.focus();
return false;}
if(IframeID.document.body.innerHTML==""){
alert("频道内容不能为空");
IframeID.document.body.focus();
return false;}
return true;}
</Script>

   <%rs1.close
set rs1=nothing
   end if
   %> 
   </table>
   
   </td>
  </tr>
</table>
<!--#include file="bottom.asp"-->
</body>
</html>

⌨️ 快捷键说明

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