editlink.asp

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

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

founderr = false
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"))) = "modify" then
	call friendlinkmodify
else
	set rs = newasp.execute("select * from nc_link where linkid="& linkid)
	if rs.bof and rs.eof then
		set rs = nothing
		call outalertscript("错误的系统参数!")
	else
		listcontent = newasp.htmlsetting(13)
		listcontent = replace(listcontent,"{$linkid}", rs("linkid"))
		listcontent = replace(listcontent,"{$linkname}", newasp.htmlencode(rs("linkname")))
		listcontent = replace(listcontent,"{$linkurl}", newasp.checktopic(rs("linkurl")))
		listcontent = replace(listcontent,"{$logourl}", newasp.checktopic(rs("logourl")))
		listcontent = replace(listcontent,"{$readme}", newasp.htmlencode(rs("readme")))
		if rs("islogo") = 0 then
			listcontent = replace(listcontent,"{$checkeda}", " checked")
			listcontent = replace(listcontent,"{$checkedb}", "")
		else
			listcontent = replace(listcontent,"{$checkeda}", "")
			listcontent = replace(listcontent,"{$checkedb}", " checked")
		end if
		htmlcontent = replace(htmlcontent, templistcontent, listcontent)
		response.write htmlcontent
	end if
	rs.close:set rs = nothing

end if
sub friendlinkmodify()
	if trim(request.form("linkname")) = "" then
		errmsg = errmsg + "网站名称不能为空\n"
		founderr = true
	end if
	if trim(request.form("linkurl")) = "" then
		errmsg = errmsg + "网站url不能为空\n"
		founderr = true
	end if
	if trim(request.form("readme")) = "" then
		errmsg = errmsg + "网站简介不能为空\n"
		founderr = true
	end if
	if trim(request.form("password")) = "" then
		errmsg = errmsg + "管理密码不能为空\n"
		founderr = true
	end if
	if newasp.isvalidpassword(request("password")) = false then
		errmsg = errmsg + "管理密码中含有非法字符\n"
		founderr = true
	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 founderr = true then
		call outalertscript(errmsg)
		exit sub
	end if
	set rs = server.createobject("adodb.recordset")
	sql = "select * from nc_link where linkid="& linkid
	rs.open sql,conn,1,3
		rs("linkname") = newasp.formencode(request.form("linkname"),50)
		rs("linkurl") = newasp.formencode(request.form("linkurl"),200)
		rs("logourl") = newasp.formencode(request.form("logourl"),200)
		rs("readme") = newasp.formencode(request.form("readme"),200)
		rs("islogo") = newasp.chknumeric(request.form("islogo"))
	rs.update
	rs.close:set rs = nothing
	call outputscript(newasp.htmlsetting(14),"index.asp")
end sub
closeconn
%>

⌨️ 快捷键说明

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