<%if Session("weight")<>5 then 
Response.Redirect "error.asp?cause=4"
 end if
%>
<%
dim db
db="../db/sjxffriend.asa"
    Set Conn = Server.CreateObject("ADODB.Connection")
myconn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
    Conn.Open MyConn
%><%
set rs=server.createobject("adodb.recordset")
if request("name")="del" then
call del()
elseif request("name")="add" then
call addlink()
elseif request("name")="yz" then
call yzlink()
else
response.write "请选择正确的参数"
end if
sub del()
sql = "delete from link where linkID="&request("id")
Set rs = Server.CreateObject("ADODB.Recordset")
conn.execute sql
Response.Redirect "url.asp"
end sub
sub addlink()
if request.form("name")="" then
response.write "错误提示:请填写友情连接名称!"
end if
if request.form("url")="" then
response.write "错误提示:请填写友网址!"
end if
if request.form("pic")="" then
response.write "错误提示:请填写LOGO网址!"
end if
sql="select * from link"
rs.open sql,conn,1,3
rs.addnew
rs("linkname")=request.form("name")
rs("linkurl")=request.form("url")
rs("linkpic")=request.form("pic")
rs("linkyz")=true
rs.update
end sub
sub yzlink()
sql="select * from link where linkID="&request("id")
rs.open sql,conn,3,3
rs("linkyz")=true
rs.update
end sub
sub yzlink()
sql="select * from link where linkID="&request("id")
rs.open sql,conn,3,3
rs("linkyz")=true
rs.update
end sub
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
Response.Redirect "url.asp"
%>