<%dbs="../"%>
<!--#include file="../inc/config.asp"-->
<!--#include file="uccook.asp"-->
<!--#include file="uc.asp"-->
<%
FMuser=request("FMuser")
Fchar=request("Fchar")
if Fchar<>"" then
Fchar="Re:"&request("Fchar")
end if
act=request.QueryString("act")
if act="fadd" then
yourname=Replace(Replace(Left(request.Form("yourname"),100),"<","["),">","]")
Fchar=Replace(Replace(Left(request.Form("Fchar"),100),"<","["),">","]")
sql="select * from H_user  where ucuser='"&yourname&"'"
set rs=server.createobject("adodb.recordset")                     
rs.open sql,conn,1,1 
if rs.eof then
response.Write"<script >alert('提示：\n\n对不起，填写的用户名可能是错误的...');history.back(-1);</script>"
response.End()
else
yourID=rs("ID")
end if 
rs.close
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from H_friends where UID="&UID&" and YID="&yourID&""
	rs.open sql,conn,1,1
	if not rs.eof then
	response.Write "<script >alert('提示：\n\n对不起，已经添加过了...');history.back(-1);</script>"
	response.End()
	end if
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from H_friends"
	rs.open sql,conn,1,3
	rs.addnew
	rs("UID")=UID'本人ID
	rs("YID")=yourID'朋友圈
	rs("Fchar")=Fchar'内容
	rs("Rdate")=now()
	rs.update
	rs.close
	set rs=nothing
	'''''''''''''''''''''''''''发送短信息	
	set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from H_Message"
	rs.open sql,conn,1,3
	rs.addnew
	rs("UID")=UID'发送人ID
	rs("YID")=yourID'收件人ID
	rs("Mtitle")=username&"用户把你加为好友"'标题
	rs("Mchar")=username&"用户把你加为好友,我也要加他为好友---<A href=FU.asp?FMuser="&username&"&Fchar=备注信息 target=_self>加为好友</a><br><br>"'内容
	rs("Mdu")=0'邮件未读状态
	rs("Rdate")=now()
	rs.update
	rs.close
	set rs=nothing	
	response.Write "<script >alert('提示：\n\n添加好友成功...');location.href='friends.asp';</script>"
end if
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<title><%=W_title%>,会员中心</title>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="style.css" type=text/css rel=stylesheet>
<SCRIPT language=javascript src="images/jquery.js" 
type=text/javascript></SCRIPT>

<SCRIPT language=javascript src="images/function.js" 
type=text/javascript></SCRIPT>

<SCRIPT language=javascript type=text/javascript>
<!--


/*
function AddnewType()
*/
-->
</SCRIPT>

<META content="MSHTML 6.00.3790.4426" name=GENERATOR>
</HEAD>
<BODY><!--用户中心头部-->
<!--#include file="top.asp"-->
<table width="960" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td width="150" valign="top"><!--#include file="left.asp"--></td>
      <td width="810" align="right" valign="top"><table width="800" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td width="20" align="center"><img src="images/ico_4.gif" width="12" height="12"></td>
                <td height="30" align="left"><a href="index.asp" target="_self">用户中心</a> <span class="uc_huise">&gt; 添加好友</span></td>
            </tr>
            <tr>
                <td height="1" colspan="2" bgcolor="#EEEEEE"></td>
        </tr>
        </table>
            <table width="600" height="5" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td></td>
                </tr>
            </table>
		
		
		
		
		
		    
			
			
			<table width="800" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
			<form action="fu.asp?act=fadd" method="post" target="_self">
              <tr>
                <td height="30" colspan="5" align="center" bgcolor="#FFFFFF">添加好友(联系人)</td>
              </tr>
              <tr>
                <td width="77" height="30" bgcolor="#FFFFFF">对方用户名：</td>
                <td width="164" bgcolor="#FFFFFF"><input name="yourname" type="text" id="yourname" value="<%=FMuser%>"></td>
                <td width="41" bgcolor="#FFFFFF">备注：</td>
                <td width="206" bgcolor="#FFFFFF"><input name="Fchar" type="text" id="Fchar" value="<%=Fchar%>" size="30"></td>
                <td width="306" align="center" bgcolor="#FFFFFF"><input name="Submit" type="submit" class="biao" value="提交"></td>
              </tr>
			  </form>
            </table></td>
    </tr>
</table>
<!--#include file="end.asp"-->

</BODY></HTML>
