<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/Conn_User.asp"-->
<%if Request.Cookies("asp163")("UserName")="" then 
  response.Redirect "User_Login.asp"
  else
  end if%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>添加好友</title>
<link href="new/css.CSS" rel="stylesheet" type="text/css">
<style type="text/css">
BODY {
	scrollbar-face-color:#DDDDDD;
	scrollbar-highlight-color: #cccccc;
	scrollbar-shadow-color: #CCCCCC;
	scrollbar-3dlight-color: #F5F5F5;
	scrollbar-darkshadow-color: #F5F5F5;
	scrollbar-track-color: #F0F0F0;
	scrollbar-arrow-color: #FFFFFF;
	margin-left: 10px;
	margin-top: 10px;
	margin-right: 10px;
	margin-bottom: 10px;
}
</style>
<link href="new/css.CSS" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--

.STYLE1 {
	color: #FFFFFF;
}
-->
</style>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body>
<%set rsds=server.createobject("adodb.recordset")
fid=Request("fid")
sql="select * from [user] where userid="&fid
rsds.open sql,Conn_User,1,3 
if rsds.bof and rsds.eof then
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="1" height="1"></td>
    <td height="1" bgcolor="#BCBCBC"></td>
    <td width="1" height="1"></td>
  </tr>
  <tr>
    <td bgcolor="#BCBCBC"></td>
    <td height="25" align="left" bgcolor="f2f2f2"><div align="center"><strong>---&nbsp;添加好友&nbsp;---</strong></div></td>
    <td bgcolor="#BCBCBC"></td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="bcbcbc">
  <tr bgcolor="ffffff">
    <td colspan="3" align="center"><p><br>
        <span class="style1"><img src="page_style/bucz.jpg" border="0" /></span><br><br><br> <A class="sbody" href="javascript:window.history.back() "target=_self><B><font color="#C00000">返回上一页</font></B></A>
        <br><br>
      <br>
    </p></td>
  </tr>
</table>

<%else%>

<%set rsd=server.createobject("adodb.recordset")
userid=request("userid")
usernames=Request.Cookies("asp163")("UserName")
fid=Request("fid")
sql="select * from [friend] where fid="&fid&" and username='"&usernames&"'"
rsd.open sql,Conn_User,1,3 
if rsd.bof and rsd.eof then
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="1" height="1"></td>
    <td height="1" bgcolor="#BCBCBC"></td>
    <td width="1" height="1"></td>
  </tr>
  <tr>
    <td bgcolor="#BCBCBC"></td>
    <td height="25" align="left" bgcolor="f2f2f2"><div align="center"><strong>---&nbsp;添加好友&nbsp;---</strong></div></td>
    <td bgcolor="#BCBCBC"></td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="bcbcbc">
  <tr bgcolor="ffffff">
    <td colspan="3" align="center"><p><br>
        <span class="style1"><img src="page_style/cg.jpg" border="0" /></span><br><br><br> <A class="sbody" href="javascript:window.history.back() "target=_self><B><font color="#C00000">返回上一页</font></B></A>
        <br><br>
        <br>
    </p></td>
  </tr>
</table>
<%
userid=request("userid")

set rs=server.createobject("adodb.recordset")
sql="select * from [friend]"
rs.open sql,Conn_User,1,3
rs.addnew
rs("fid")=fid
rs("username")=Request.Cookies("asp163")("UserName")
rs.update
rs.close
%>
<%else%>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="1" height="1"></td>
      <td height="1" bgcolor="#BCBCBC"></td>
      <td width="1" height="1"></td>
    </tr>
    <tr>
      <td bgcolor="#BCBCBC"></td>
      <td height="25" align="left" bgcolor="f2f2f2"><div align="center"><strong>---&nbsp;添加好友&nbsp;---</strong></div></td>
      <td bgcolor="#BCBCBC"></td>
    </tr>
  </table>
  <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="bcbcbc">
    <tr bgcolor="ffffff">
      <td colspan="3" align="center"><p><br>
          <span class="style1"><img src="page_style/tianjg.jpg" border="0" /></span><br><br><br> <A class="sbody" href="javascript:window.history.back() "target=_self><B><font color="#C00000">返回上一页</font></B></A>
        <br><br>
      </p>
      </td>
    </tr>
  </table>
  <%end if%>

</body>
</html>

<%

rsd.close
set rs=nothing
%>
<%end if%>