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

📄 admin_friendlink.asp

📁 南鄂电子商务学校网: 学校概况、校园动态、师资力量、教学成果、师生论坛、友情链接
💻 ASP
字号:
<!--#include file="config.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="format.asp"-->
<!--#include file="error.asp"-->
<!--#include file="body/incjs.asp"-->
<!--#include file="body/adminmenu.asp"-->
<!--#include file="body/adminfriendlink_body.asp"-->
<!--#include file="body/foot.asp"-->
<title><%=webname%>-链接管理</title>
<script language="javascript">
  if(top.frames.length == 0)
  {
    document.location = "login.asp";
  }
  else
  {
    if(parent.ryan_bar)
    {
    }
    else
    {
      parent.location = "login.asp";
    }
  }
</script>
<%
dim founderr,errmsg
isimage=true
founderr=false
errmsg=""

if session("adminlogin")<>sessionvar then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你尚未登录,或者超时了!请<a href='admin.asp'>重新登录</a>!"
  call diserror()
  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
  errmsg=errmsg+"<br>"+"<li>你必须填写分类名称!"
else
  rs("flcat_name")=flcatname
end if
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_friendlink.asp"
end if
end if
if request.form("action")="editflcat" then
if request.Form("id")="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
  if not isInteger(request.form("id")) then
    founderr=true
    errmsg=errmsg+"<br>"+"<li>非法的链接分类id参数。"
  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
  errmsg=errmsg+"<br>"+"<li>你必须填写分类名称!"
else
  rs("flcat_name")=flcatname
end if
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_friendlink.asp"
end if
end if
if request.form("action")="delflcat" then
if request.Form("id")="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
  if not isInteger(request.form("id")) then
    founderr=true
    errmsg=errmsg+"<br>"+"<li>非法的链接分类id参数。"
  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)
  closedatabase
  response.redirect "admin_friendlink.asp"
end if
if request.form("action")="editfl" then
if request.Form("id")="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
  if not isInteger(request.form("id")) then
    founderr=true
    errmsg=errmsg+"<br>"+"<li>非法的链接分类id参数。"
  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"),"'",""))
if flcatid<1 then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>非法的链接分类参数!"
else
  rs("flcat_id")=flcatid
end if
if flname="" then
   founderr=true
   errmsg=errmsg+"<br>"+"<li>站点名称未填写!"
else
  if strLength(flname)>16 then
      founderr=true
	  errmsg=errmsg+"<br>"+"<li>站点名称太长,不可以超过16个字符!"
  else
      rs("fl_name")=flname
  end if
end if
if flurl="" then
   founderr=true
   errmsg=errmsg+"<br>"+"<li>站点地址未填写!"
else
  if strLength(flurl)>150 then
      founderr=true
	  errmsg=errmsg+"<br>"+"<li>站点地址太长,不可以超过150个字符!"
  else
      rs("fl_url")=flurl
  end if
end if
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_friendlink.asp?action=link"
end if
end if
if request.form("action")="delfl" then
if request.Form("id")="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
  if not isInteger(request.form("id")) then
    founderr=true
    errmsg=errmsg+"<br>"+"<li>非法的链接分类id参数。"
  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_friendlink.asp?action=link"
end if

end if

call adminfriendlink_body()
closedatabase
call endpage()
end if
%>

⌨️ 快捷键说明

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