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

📄 admin_friendsitesave.asp

📁 青岛dj站程序,带后台管理 名字和密码都是:admin
💻 ASP
字号:
<!--#include file="function.asp"-->
<%CheckAdmin2%>
<!--#include file="conn.asp"-->
<!--#include file="inc/char.inc"-->
<%
ID=request.QueryString("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

	set rs=server.createobject("adodb.recordset")
	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
	set rs=server.createobject("adodb.recordset")
	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
	set rs=server.createobject("adodb.recordset")
	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 + -