<!--#include file="mdb.asp"-->
<!--#Include File="Check_hx.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/format.asp"-->
<%
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
Response.Write("<script language=javascript>alert('你提交的路径有误，禁止从站点外部提交数据请不要乱改参数！');this.location.href='http://vip138.com/';</script>") 
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select fl_name,fl_name from friendlink where fl_name='"&trim(request.form("fl_name"))&"' or fl_url='"&trim(request.form("fl_url"))&"'",conn,1,1
if not rs.eof and not rs.bof then
	   	   Response.Write("<script language=javascript>alert('错误提示：\n\n① 您的站点已经提交过，正在等待审核通过，请不要重复提交!\n\n② 您的站点已经通过审核，请不要重复提交!\n\n③ 您的站点已经通过审核，但是因为违反协议已被拉入黑名单，请跟管理员联系!');</script>")
		   Response.End
rs.close
end if
dim isimage
isimage=true
sql="select * from friendlink"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
if strLength(trim(request.form("fl_name")))<=2 then
   Response.Write("<script language=javascript>alert('站点名称未填写！');</script>")
   response.end
else
  if strLength(trim(request.form("fl_name")))>30 then
      Response.Write("<script language=javascript>alert('站点名称太长，不可以超过30个字符！');</script>")
      response.end
  else
      rs("fl_name")=CheckStr(request.form("fl_name"))
  end if
end if
if strLength(trim(request.form("fl_url")))<=12 then
   Response.Write("<script language=javascript>alert('站点地址未填写完整！');</script>")
   response.end
else
  if strLength(trim(request.form("fl_url")))>100 then
      Response.Write("<script language=javascript>alert('站点地址太长，不可以超过100个字符！');</script>")
      response.end
  else
      rs("fl_url")=CheckStr(request.form("fl_url"))
  end if
end if

if cint(request.Form("flcat_id"))<1 then
     Response.Write("<script language=javascript>alert('请选择分类！');</script>")
     response.end
else
   sql="select isimage from flcat where flcat_id="&cint(request.Form("flcat_id"))
   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")=cint(request.Form("flcat_id"))
end if
if isimage=true then
if strLength(trim(request.form("fl_logo")))<20 or strLength(trim(request.form("fl_logo")))>100 then
      Response.Write("<script language=javascript>alert('站点logo地址没填写或太长，不可以超过100个字符！');</script>")
      response.end
  else
      rs("fl_logo")=CheckStr(request.form("fl_logo"))
end if
end if
rs("passed")=1
rs("lk")=0
rs.update
rs.close
set rs=nothing
Response.Write("<script language=javascript>alert('已经成功提交，请等待批准。请确认已经在您的站点加入我们相应的链接!');</script>")
%>