delink.asp

来自「小游戏网站演示www.4399.io 拥有4万条游戏数据」· ASP 代码 · 共 75 行

ASP
75
字号
<!--#include file="../conn.asp"-->
<!--#include file="../inc/const.asp"-->
<!--#include file="../inc/md5.asp"-->
<!--#include file="../inc/classmenu.asp"-->
<%
'dim rs, linkid
dim htmlcontent,listcontent,templistcontent

newasp.preventinfuse

newasp.loadtemplates 9999, 6, 0

htmlcontent = newasp.htmlcontent
htmlcontent = replace(htmlcontent,"{$installdir}", newasp.installdir)
htmlcontent = replace(htmlcontent, "{$channelid}", 0)
htmlcontent = replace(htmlcontent,"{$pagetitle}","删除友情连接")
htmlcontent = readclassmenu(htmlcontent)
htmlcontent = readclassmenubar(htmlcontent)
templistcontent = newasp.cutfixcontent(htmlcontent, "<!--listbegin", "listend-->", 1)

linkid = newasp.chknumeric(request("id"))

if linkid = 0 then
	response.write"错误的系统参数!"
	response.end
end if
if newasp.checkstr(lcase(request.form("action"))) = "del" then
	call linkdel
else
	set rs = newasp.execute("select linkid,linkname,linkurl from nc_link where linkid="& linkid)
	if rs.bof and rs.eof then
		set rs = nothing
		call outalertscript("错误的系统参数!")
	else
		listcontent = newasp.htmlsetting(8)
		listcontent = replace(listcontent,"{$linkid}", rs("linkid"))
		listcontent = replace(listcontent,"{$linkname}", newasp.htmlencode(rs("linkname")))
		listcontent = replace(listcontent,"{$linkurl}", newasp.checktopic(rs("linkurl")))
		htmlcontent = replace(htmlcontent, templistcontent, listcontent)
		response.write htmlcontent
	end if
	rs.close:set rs = nothing
end if

sub linkdel()
	if trim(request.form("password")) = "" then
		call outalertscript(newasp.htmlsetting(9))
		exit sub
	end if
	set rs = newasp.execute("select password from nc_link where linkid="& linkid)
	if rs.bof and rs.eof then
		set rs = nothing
		call outalertscript("错误的系统参数!")
		exit sub
	else
		if not isnull(trim(rs("password"))) and trim(rs("password")) <> "" then
			if rs("password") <> md5(request.form("password")) then
				set rs = nothing
				call outalertscript(newasp.htmlsetting(10))
				exit sub
			end if
		else
			set rs = nothing
			call outalertscript(newasp.htmlsetting(11))
			exit sub
		end if
	end if
	set rs = nothing
	if newasp.checkstr(lcase(request.form("action"))) = "del" then
		newasp.execute("delete from nc_link where linkid="& linkid)
		call outputscript("友情连接删除成功!","index.asp")
	end if
end sub
closeconn
%>

⌨️ 快捷键说明

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