<!--#include file="sd_mdb.asp"-->
<!--#include file="sd_checkuser.asp"-->
<%
webid=request.QueryString("id")
if trim(webid)="" then
	Response.Write ("<script language=javascript>alert('无法获得相关ID！');history.back(-1);</script>")
	response.end
else
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
%>
<%
sql="select * from sd_Web where sd_id="&webid 
rs.open sql,conn,1,1 
'取得页面地址 
html="html"&"/"&rs("sd_id")&".html"
filepath = server.mappath(html) 
'创建FSO对象，用于删除文件 
set fso = server.createobject("scripting.filesystemobject") 
'判断文件是否存在，如果存在则删除 
if fso.fileexists(filepath) then fso.deletefile(filepath) 
'关闭RescordSet对象 
rs.close() 
	conn.execute("delete * from [sd_web] where sd_id="&webid)
	response.write"<SCRIPT language=JavaScript>alert('网站数据删除成功！');location='sd_user_main.asp';</SCRIPT>"	
end if
%>