📄 admin_adsave.asp
字号:
<!--#include file="session.asp"-->
<%checkAdmin2%>
<!--#include file="conn.asp"-->
<%
ID=request.QueryString("id")
AdName=trim(request.form("AdName"))
AdUrl=trim(request.form("AdUrl"))
AdPic=trim(request.form("AdPic"))
AdAdd=trim(request.form("AdAdd"))
Adwidth=trim(request.form("Adwidth"))
Adheight=trim(request.form("Adheight"))
AdIntro=trim(request.form("AdIntro"))
IsFlash=Request.Form("IsFlash")
if IsEmpty(IsFlash) then
IsFlash=false
else
IsFlash=true
end if
act=request("act")
founderr=false
if act="add" or act="edit" then
if AdName="" then
errmsg=errmsg+"<li>站名不能为空!"
founderr=true
end if
if AdUrl="" then
errmsg=errmsg+"<li>网址不能为空!"
founderr=true
end if
if AdPic="" then
errmsg=errmsg+"<li>网站banner不能为空!"
founderr=true
end if
if Adintro="" then
errmsg=errmsg+"<li>网站说明不能为空!"
founderr=true
end if
if act="edit" then sql="select * from ad where ID="&ID
if act="add" then sql="select * from ad"
rs.open sql,conn,1,3
if act="edit" then
if rs.eof then
errmsg=errmsg+"<li>操作错误!请联系管理员"
call error()
Response.End
end if
end if
if act="add" then
rs.addnew
end if
rs("AdName")=AdName
rs("AdUrl")=AdUrl
rs("AdPic")=AdPic
rs("AdAdd")=AdAdd
if Adwidth="" then
rs("Adwidth")=0
else
rs("Adwidth")=Adwidth
end if
if Adheight="" then
rs("Adheight")=0
else
rs("Adheight")=Adheight
end if
rs("AdIntro")=AdIntro
rs("IsFlash")=IsFlash
rs.update
rs.close
set rs=nothing
elseif act="del" then
sql="delete from ad where id=" & ID
conn.execute sql
elseif act="set" then
sql="Select checked from ad where checked=1"
rs.open sql,conn,1,3
if not rs.eof then
do while not rs.eof
rs("checked")=0
rs.update
rs.movenext
loop
end if
rs.close
checked=replace(request.form("checked")," ","")
checkedNum=Split(checked,",")
HowLong=UBound(checkedNum)
for i=0 to HowLong
sql="Select checked from ad where ID="&checkedNum(i)
rs.open sql,conn,1,3
if not rs.EOF then
do while not rs.EOF
rs("checked")=1
rs.update
rs.MoveNext
loop
end if
rs.close
next
set rs=nothing
end if
conn.close
set conn=nothing
if founderr=true then
call error()
else
Response.Redirect "admin_AdMana.asp"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -