<!--#include file="sd_mdb.asp"-->
<!--#include file="sd_checkuser.asp"-->
<%
webid=request.form("id")
sql="select * from sd_Web where sd_userid="&session("sd_userid")&" and sd_id="&webid
rs.open sql,conn,1,1 
%>
<%
sd_Userid=rs("sd_Userid")
sql="select * from sd_User where sd_userid="&session("sd_userid")&" and sd_Userid='"&sd_Userid&"'"
	rs.open sql,conn,1,1
If session("sd_userid") <> Rs("sd_Userid") Then
	response.Write "<script LANGUAGE='javascript'>alert('您没有权限修改别人的友情链接资料！');history.go(-1);</script>"
	response.end
end if
%>
<%
submit_linkname=request.form("submit_linkname")
submit_class1=request.form("submit_class1")
submit_class3=request.form("submit_class3")
sd_classid=request.form("sd_classid")
submit_price=request.form("submit_price")
yaoqiu1=request.form("yaoqiu1")
yaoqiu2=request.form("yaoqiu2")
yaoqiu3=request.form("yaoqiu3")
yaoqiu4=request.form("yaoqiu4")
yaoqiu5=request.form("yaoqiu5")
submit_qq=request.form("submit_qq")
submit_shuoming=request.form("submit_shuoming")
submit_kz=request.form("seo_kz_0")
submit_qz=request.form("seo_qz_0")
submit_baidu=request.form("seo_baidu_0")
submit_google=request.form("seo_google_0")
submit_pr=request.form("seo_pr_0")
submit_alexa=request.form("seo_alexa_0")
sd_TopEndTime=request.form("sd_TopEndTime")

set rs=server.CreateObject("adodb.recordset")
sql="select * from [sd_web] where sd_id="& webid
rs.open sql,conn,1,3 
if not (rs.eof and rs.bof) then
	rs("sd_WEBNAME")=submit_linkname
	rs("sd_Classid")=sd_Classid
	rs("sd_jg")=submit_price
	rs("sd_jy")=submit_class1
	rs("sd_lx")=submit_class3
	rs("sd_YQ1")=yaoqiu1
	rs("sd_YQ2")=yaoqiu2
	rs("sd_YQ3")=yaoqiu3
	rs("sd_YQ4")=yaoqiu4
	rs("sd_YQ5")=yaoqiu5
	rs("sd_content")=submit_shuoming
	rs("sd_QQ")=submit_qq
	rs("sd_PR")=submit_pr
	rs("sd_baiduqz")=submit_qz
	rs("sd_kz")=submit_kz
	rs("sd_BAIDU")=submit_baidu
	rs("sd_GOOGLE")=submit_google
	rs("sd_ALEXA")=submit_alexa
	rs("sd_regTime")=now()
	if request("sd_TopEndTime")<>"" then
	rs("sd_TopEndTime")=now()
	end if
	rs.update
	rs.close
	set rs=nothing
sql="select * from sd_web where sd_id="&webid 
rs.open sql,conn,1,1 
'取得页面地址 
html="html"&"/"&webid&".html"

filepath = server.mappath(html) 
'创建FSO对象，用于删除文件 
set fso = server.createobject("scripting.filesystemobject") 
'判断文件是否存在，如果存在则删除 
if fso.fileexists(filepath) then fso.deletefile(filepath) 
'关闭RescordSet对象 
rs.close() 
	Response.Write ("<script language=javascript>alert('友情链接修改成功！');this.location.href='sd_html.asp?id="&webid&"';</script>")
	response.end
else
	rs.close
	set rs=nothing
	Response.Write ("<script language=javascript>alert('没有找到相关ID记录！');this.location.href='sd_user_main.asp';</script>")
	response.end
end if
%>