📄 admin_link.asp
字号:
<!--#include file="inc/config.asp"-->
<!--#include file="mdb.asp"-->
<!--#include file="inc/FORMAT.asp"-->
<title><%=webname%>-链接管理</title>
<%
if session("adminlogin")<>sessionvar then
Response.Write("<script language=javascript>alert('你尚未登录,或者超时了!请重新登录');this.top.location.href='admin.asp';</script>")
response.end
else
if request.form("MM_insert") then
if request.form("action")="newflcat" then
sql="select * from flcat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim flcatname
flcatname=trim(replace(request.form("flcat_name"),"'",""))
if flcatname="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写分类名称!');history.back(1);</script>")
else
rs("flcat_name")=flcatname
end if
if request.form("isimage")=1 then
rs("isimage")=1
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_link.asp"
end if
end if
if request.form("action")="editflcat" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的文章分类id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from flcat where flcat_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
flcatname=trim(replace(request.form("flcat_name"),"'",""))
if flcatname="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写分类名称!');history.back(1);</script>")
else
rs("flcat_name")=flcatname
end if
if request.form("isimage")<>"" then
rs("isimage")=1
else
rs("isimage")=0
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_link.asp"
end if
end if
if request.form("action")="delflcat" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的分类id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from flcat where flcat_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=nothing
sql="update allcount set friendlinkcount = friendlinkcount - 1"
conn.execute(sql)
response.redirect "admin_link.asp"
end if
if request.form("action")="editfl" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的文章分类id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from friendlink where fl_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
flcatid=cint(request.form("flcat_id"))
flname=trim(replace(request.form("fl_name"),"'",""))
flurl=trim(replace(request.form("fl_url"),"'",""))
fllogo=trim(replace(request.form("fl_logo"),"'",""))
if flcatid<1 then
founderr=true
Response.Write("<script language=javascript>alert('非法的分类参数!');history.back(1);</script>")
else
sql="select isimage from flcat where flcat_id="&cint(request.form("flcatid"))
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
if rs2("isimage")=1 then
isimage=false
end if
rs2.close
set rs2=nothing
rs("flcat_id")=flcatid
end if
if flname="" then
founderr=true
Response.Write("<script language=javascript>alert('站点名称未填写!');history.back(1);</script>")
else
if strLength(flname)>50 then
founderr=true
Response.Write("<script language=javascript>alert('站点名称太长,不可以超过50个字符!');history.back(1);</script>")
else
rs("fl_name")=flname
end if
end if
if flurl="" then
founderr=true
Response.Write("<script language=javascript>alert('站点地址未填写!');history.back(1);</script>")
else
if strLength(flurl)>100 then
founderr=true
Response.Write("<script language=javascript>alert('站点地址太长,不可以超过100个字符!');history.back(1);</script>")
else
rs("fl_url")=flurl
end if
end if
rs("fl_logo")=fllogo
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_link.asp?action=link"
end if
end if
if request.form("action")="pass" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的分类id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from friendlink where fl_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
flcatid=cint(request.form("flcat_id"))
flname=trim(replace(request.form("fl_name"),"'",""))
flurl=trim(replace(request.form("fl_url"),"'",""))
fllogo=trim(replace(request.form("fl_logo"),"'",""))
if flcatid<1 then
founderr=true
Response.Write("<script language=javascript>alert('非法的分类参数!');history.back(1);</script>")
else
sql="select isimage from flcat where flcat_id="&cint(request.form("flcatid"))
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
if rs2("isimage")=1 then
isimage=false
end if
rs2.close
set rs2=nothing
rs("flcat_id")=flcatid
end if
if flname="" then
founderr=true
Response.Write("<script language=javascript>alert('站点名称未填写!');history.back(1);</script>")
else
if strLength(flname)>50 then
founderr=true
Response.Write("<script language=javascript>alert('站点名称太长,不可以超过50个字符!');history.back(1);</script>")
else
rs("fl_name")=flname
end if
end if
if flurl="" then
founderr=true
Response.Write("<script language=javascript>alert('站点地址未填写!');history.back(1);</script>")
else
if strLength(flurl)>100 then
founderr=true
Response.Write("<script language=javascript>alert('站点地址太长,不可以超过100个字符!');history.back(1);</script>")
else
rs("fl_url")=flurl
end if
end if
rs("fl_logo")=fllogo
if founderr then
call diserror()
response.end
else
rs("passed")=0
rs.update
conn.execute(sql)
sql="update allcount set friendlinkcount = friendlinkcount + 1"
rs.close
set rs=nothing
response.redirect "admin_link.asp?action=check"
end if
end if
if request.form("action")="lkpass" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的分类id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from friendlink where fl_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs("lk")=0
rs.update
rs.close
set rs=nothing
response.redirect "admin_link.asp?action=lk"
end if
if request.form("action")="lklk" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的分类id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from friendlink where fl_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs("lk")=1
rs.update
rs.close
set rs=nothing
response.redirect "admin_link.asp?action=link"
end if
if request.form("action")="delfl" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的分类id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from friendlink where fl_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=nothing
response.redirect "admin_link.asp?action=link"
end if
if request.form("action")="delnopass" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的分类id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from friendlink where fl_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=nothing
response.redirect "admin_link.asp?action=check"
end if
if request.form("action")="lkdel" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的分类id参数。');history.back(1);</script>")
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -