📄 admin_ads.asp
字号:
<!--#include file="config.asp"-->
<%
dim founderr,errmsg
founderr=false
errmsg=""
if session("adminlogin")<>sessionvar then
founderr=true
errmsg=errmsg+"<br>"+"<li>你尚未登录,或者超时了!请<a href='index.asp'>重新登录</a>!"
call diserror()
response.end
end if
if session("flag")>1 then
errmsg=errmsg+"<br>"+"<li>你的管理权限不够!!</a>!"
call diserror()
response.end
end if
if Request("action")="edit" then
wopen=Request("open")
js=Request("js")
m=Request("m")
set r=server.createobject("adodb.recordset")
r.open "select * from happywz_ADS where id="&Request("id"),conn,1,3
if not r.eof then
r("open")=wopen
r("js")=js
r("m")=m
r.update
end if
str=""
if wopen="false" then
str="广告位"
else
str=str&"document.write('"&js&"')"
end if
Set fso= Server.CreateObject(""&fsoset&"")
set fd=fso.createtextfile(server.MapPath("..\js\adurl"&Request("id")&".js"),true)
fd.writeline str
fd.close
r.close
set r=nothing
errmsg="<li>广告信息修改成功!"
call disok()
Response.End
end if
if Request("action")="add" then
if Request("title")="" then
errmsg="<li>表单填写不完整!!"
call diserror()
Response.End
end if
set rss=server.createobject("adodb.recordset")
rss.open "select * from happywz_ADS",conn,1,3
rss.addnew
rss("open")=true
rss("js")="填写你自己的代码"
rss("m")=Request("title")
rss.update
rss.close
set rss=nothing
str=""
if wopen="false" then
str="广告位"
else
str=str&"document.write('"&Request("js")&"')"
end if
Set fso= Server.CreateObject(""&fsoset&"")
set fd=fso.createtextfile(server.MapPath("..\js\adurl"&id&".js"),true)
fd.writeline str
fd.close
errmsg="<li>广告位置已经提交成功!"
call disok()
Response.End
end if
if Request("action")="del" then
if Request("id")="" then
response.write"<SCRIPT language=JavaScript>alert('没有该广告位置,或者该广告位置已经删除。!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
conn.execute "delete * from happywz_ADS where id=" & Request("id")
Set fso = CreateObject(""&fsoset&"")
fso.DeleteFile(server.MapPath("..\js\adurl"&n&".js"))
response.write"<SCRIPT language=JavaScript>alert('广告位置删除成功,返回!');"
response.write"location.href='admin_ads.asp'</SCRIPT>"
response.end
end if%>
<html>
<head>
<title>管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
</head>
<body LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0"><script>if(top==self)top.location="index.asp" </script>
<table width="96%" border="1" align="center" cellpadding="1" cellspacing="0" bordercolor="#0099CF" style="border-collapse: collapse">
<form name="form" method="post" action="Admin_Ads.asp?action=add">
<tr>
<td height="0" colspan="2" bgcolor="#0099CF"><div align="center"><font color="#FFFFFF">添加广告</div></font></td>
</tr>
<tr bgcolor="#ffffff">
<td width="25%"><p>广告位置:</p> </td>
<td width="75%"><input name="title" id="title"></td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="2"><div align="center">
<input name="submit" type="submit" style="FONT-SIZE: 9pt" value="添加">
</div></td>
</tr>
</form>
</table>
<div align="center"><br>
<table width="96%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#0099CF" style="border-collapse: collapse">
<%set r=server.createobject("adodb.recordset")
r.open "select * from happywz_ADS",conn,1,3
jishu=1
while not r.eof
if jishu=1 or jishu mod 8=1 then%><tr align="center" bgcolor="#0099CF"><td><a href="?id=<%=r("id")%>" target="_self"><font color="#FFFFFF"><%=r("m")%></font></a></td>
<%else%><td><a href="?id=<%=r("id")%>" target="_self"><font color="#FFFFFF"><%=r("m")%></font></a></td>
<%end if
if jishu mod 8=0 then%></tr><%
end if
jishu=jishu+1
r.movenext
wend
r.close
set r=nothing%></tr>
</table>
</div>
<p align="center"></p>
<%id=request("id")
if id="" then
id=1
end if
sql="select * from happywz_ADS where id=" &id
set rsn=conn.execute(sql)
id=rsn("id")
adsjs=rsn("js")
adsopen=rsn("open")
adsm=rsn("m")
conn.execute (sql)
rsn.close
set rsn=nothing
%>
<div align="center">
<form name="form1" method="post" action="Admin_Ads.asp?action=edit&id=<%=id%>">
<table width="96%" border="1" bgcolor="#ffffff" border="0" align="center" cellpadding="2" cellspacing="0" bordercolor="#0099CF" style="border-collapse: collapse">
<tr>
<td height="25" colspan="2" bgcolor="#0099CF"><div align="center"><font color="#FFFFFF">广告信息设置(<%=adsm%>)</font></div></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<%=adsjs%>
</div></td>
</tr>
<tr>
<td colspan="2">将调用代码拷贝至需要处:
<input name="textfield" type="text" size="85" value="<script language='javascript' src='<%=weburl%>/js/adurl<%=id%>.js'></script>">
</td>
</tr>
<tr>
<td>广告位置:
<input name="m" type="text" value="<%=adsm%>" size="50">
</td> <td width="207">是否开放:
<input name="open" type=radio value=true <%if adsopen=true then%>checked<%end if%>>
是
<input name="open" type=radio value=false <%if adsopen=false then%>checked<%end if%>>
否</td>
</tr><tr>
<td colspan="2">代码:
<textarea name="js" cols="70" rows="4" id="js"><%=adsjs%></textarea>部分代码不能应用此栏</td>
</tr> <tr>
<td><div align="center">
<input type="submit" name="Submit" value="确认修改">
<input type="reset" name="Submit2" value="重新设定">
</div></td>
<td><a href="admin_ads.asp?id=<%=id%>&action=del" color="ff0000">点击删除广告</a> 不可逆,请小心操作
</td></form>
</tr>
</table>
</div><br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -