📄 admin_friendsitesave.asp
字号:
<%@ codepage ="936" %>
<%
if instr(session("flag"),"51")=0 then
response.redirect "../login.asp"
response.end
end if
%>
<LINK rel="stylesheet" type="text/css" href="../style.css">
<!--#include file="session.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="char.inc"-->
<%
ID=request("id")
SiteName=trim(request.form("SiteName"))
SiteUrl=trim(request.form("SiteUrl"))
LogoUrl=trim(request.form("LogoUrl"))
SiteAdmin=trim(request.form("SiteAdmin"))
SiteIntro=trim(request.form("SiteIntro"))
act=request("act")
founderr=false
if act="add" or act="edit" then
if trim(SiteName)="" then
errmsg=errmsg+"<br>"+"<li>站名不能为空!"
founderr=true
end if
if trim(SiteUrl)="" then
errmsg=errmsg+"<br>"+"<li>网址不能为空!"
founderr=true
end if
if act="edit" then sql="select * from FriendSite where ID="&ID
if act="add" then sql="select * from FriendSite"
rs.open sql,conn,1,3
if act="edit" then
if rs.eof then
errmsg=errmsg+"<br>"+"<li>操作错误!请联系管理员"
call error()
Response.End
end if
end if
if act="add" then
rs.addnew
end if
rs("SiteName")=SiteName
rs("SiteUrl")=SiteUrl
if SiteAdmin="" then
rs("SiteAdmin")=null
else
rs("SiteAdmin")=SiteAdmin
end if
if LogoUrl="" then
rs("LogoUrl")=null
else
rs("LogoUrl")=LogoUrl
end if
if SiteIntro="" then
rs("SiteIntro")=null
else
rs("SiteIntro")=SiteIntro
end if
rs.update
rs.close
set rs=nothing
elseif act="del" then
sql="delete from FriendSite where id=" & ID
conn.execute sql
elseif act="set" then
sql="Select isOK from FriendSite where IsOK=true"
rs.open sql,conn,1,3
if not rs.eof then
do while not rs.eof
rs("IsOK")=false
rs.update
rs.movenext
loop
end if
rs.close
checked=replace(request("checked")," ","")
checkedNum=Split(checked,",")
HowLong=UBound(checkedNum)
for i=0 to HowLong
sql="Select IsOK from FriendSite where ID="&checkedNum(i)
rs.open sql,conn,1,3
if not rs.EOF then
do while not rs.EOF
rs("isOK")=true
rs.update
rs.MoveNext
loop
end if
rs.close
next
set rs=nothing
elseif act="SetIsGood" then
sql="Select IsGood from FriendSite where ID="&id
rs.open sql,conn,1,3
if not rs.EOF then
if rs("IsGood")=true then
rs("IsGood")=false
else
rs("isGood")=true
end if
rs.update
end if
rs.close
set rs=nothing
end if
conn.close
set conn=nothing
if founderr=true then
call error()
else
Response.Redirect "admin_FriendSiteMana.asp"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -