<!--#include file="../act_inc/ACT.User.asp"-->
<%
	ConnectionDatabase
		Response.Write "<html>"
		Response.Write "<head>"
		Response.Write "<meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312"">"
		Response.Write "<title>保存申请友情链接</title>"
		Response.Write "</head>"
		Dim LinkID, ClassLinkID, SiteName, Webadmin, Email,   Locked, Url, LinkType, Logo, Hits, Rec, Descript, TrueIP,Code
		Dim TempObj, LinkRS, LinkSql
		LinkID = ACTCMS.RSQL(Replace(Replace(Request.Form("LinkID"), """", ""), "'", ""))
		SiteName = ACTCMS.RSQL(Request.Form("SiteName"))
		Webadmin = ACTCMS.RSQL(Request.Form("Webadmin"))
		Email = ACTCMS.RSQL(Request.Form("Email"))
		ClassLinkID = Replace(Replace(Request.Form("ClassLinkID"), """", ""), "'", "")
		Code=ACTCMS.S("Code")
		Locked = 0
		Url = Replace(Replace(Request.Form("Url"), """", ""), "'", "")
		LinkType = Replace(Replace(Request.Form("LinkType"), """", ""), "'", "")
		Logo = Replace(Replace(Request.Form("Logo"), """", ""), "'", "")
		Hits = 0
		Rec = 0
		Descript = ACTCMS.RSQL(Request.Form("Description"))
		IF Trim(Request.Form("Code"))<>Trim(Session("GetCode")) then 
			Call Alert("验证码有误，请重新输入!", "")
			Response.End		
		end If
		IF ClassLinkID="" then 
			Call Alert("所属类别为空", "")
			Response.End		
		end if
		If SiteName <> "" Then
				If Len(SiteName) >= 200 Then
					Call Alert("网站名称不能超过100个字符!", "")
					
					 Response.End
				End If
		 Else
				Call Alert("请输入网站名称!", "")
				 Response.End
		 End If
				Set TempObj = Conn.Execute("Select SiteName from [Link_Act] where SiteName='" & SiteName & "'")
				If Not TempObj.EOF Then
					Call Alert("数据库中已存在该友情链接的站点名称!", "LinkAdd.asp")
					Response.End
				End If
			  Set LinkRS = Server.CreateObject("adodb.recordset")
			  LinkSql = "select * from [Link_Act] Where (ID IS NULL)"
			  LinkRS.Open LinkSql, Conn, 1, 3
			  LinkRS.AddNew
			  LinkRS("SiteName") = SiteName
			  LinkRS("Webadmin") = Webadmin
			  LinkRS("Email") = Email
			  LinkRS("ClassLinkID") = ClassLinkID
			  LinkRS("Locked") = Locked
			  LinkRS("Url") = Url
			  LinkRS("LinkType") = LinkType
			  LinkRS("Logo") = Logo
			  LinkRS("Rec") = Rec
			  LinkRS("Description") = Descript
			  LinkRS("AddDate") = Now
			  LinkRS("sh") = 0
			  LinkRS.Update
			  LinkRS.Close
			  Set LinkRS = Nothing
			  Response.Write ("<script> alert('您的申请已成功提交,请等待网站管理员的审核!'); location.href='Index.asp';</script>")
%> 
