<%Set rs33=Server.CreateObject("ADODB.Recordset")
rs33.open "friendpm",conn,1,3
Select Case request("act")
case "add"
sql="select * from id where user='"&request("name")&"'"
sql1="select * from friendpm where friendname='"&request("name")&"'"&"and user='"&request.cookies("UserID")&"'"
set rs=conn.execute(sql)
set rs1=conn.execute(sql1)
if rs.eof then%>
<%elseif not rs1.eof then%>
<%else
rs33.addnew
rs33("user")=request.cookies("UserID")
rs33("friendname")=request("name")
rs33.update
rs33.close
end if
case "delete"
If not rs33.EOF then rs33.movefirst
while not rs33.eof
if request(rs33("id"))="on" then
rs33.delete
end if
rs33.movenext
wend
end select%>