<!--#include file="Top.asp" -->
<%
GetErrInfo=" 【提示：输入您要发送的用户名及内容发送消息!】"
IF CblogObj.FormRequest("PostMessage")="Post" Then
	IF Not CblogObj.CodeIsTrue() Then
		GetErrInfo=" <div class=""err""> 【操作失败提示:验证码错误!】</div>"
	Else
		IF CblogObj.FormRequest("UserName")=Session("UserName") Then
			GetErrInfo=" <div class=""err""> 【操作疑问:你对自已发什么消息?】</div>"
		Else
			IF CblogObj.FormRequest("zy")<>"" And CblogObj.FormRequest("UserName")<>"" Then
				Set Rs=Conn.ExeCute("Select ID From Tb_User Where User_Name='"& CblogObj.FormRequest("UserName") &"'")
				IF Not Rs.Eof Then
					Conn.Execute("INSERT INTO [Message](UserID,UserName,Message,Messdate) VALUES("& Rs(0) &",'"& Session("UserName") &"','"& Left(CblogObj.FormRequest("zy"),250) &"','"&Now&"')")
					GetErrInfo=" <div class=""doen""> 【操作成功提示:发送消息成功!】</div>"
				Else
					GetErrInfo=" <div class=""err""> 【操作失败提示:此用户名不存在!】</div>"
				End IF
				Rs.Close:Set Rs=Nothing
			Else
				GetErrInfo=" <div class=""err""> 【操作失败提示:消息内容或收件人不能为空!】</div>"
			End IF
		End IF
	End IF
End IF
%>
<script language="javascript" src="../inc/js.js"></script>
<table width="99%" border="0" align="center" cellpadding="5" cellspacing="0">
  <tr> 
    <td height="30" bgcolor="#FFFFFF"><table width="200" border="0" align="right" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="120" class="box3"> <div align="center"><a href="Message_Post.Asp">发消息</a></div></td>
          <td>-</td>
          <td width="120" class="box3"> <div align="center"><a href="Message_List.Asp">我的消息</a></div></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td height="30" bgcolor="#FFFFFF" class="h1"><img src="img/GuestBook.gif" width="23" height="21"> 
      发送消息 
      <hr size="0"></td>
  </tr>
  <tr> 
    <td valign="top" bgcolor="#FFFFFF" class="h1"> <table width="100%" border="0" cellspacing="0" cellpadding="10">
        <tr> 
          <td class="box"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td width="2%" valign="middle"><img src="img/3.gif" width="16" height="16"></td>
                <td width="98%" valign="middle"><%=GetErrInfo%></td>
              </tr>
            </table></td>
        </tr>
        <tr height="5"> 
          <td height="5"></td>
        </tr>
        <tr>
          <td><table width="100%" border="0" align="center" cellpadding="4" cellspacing="0">
              <form name="input" method="post" action="">
                <tr>
                  <td align="right" nowrap><strong>验证码：</strong></td>
                  <td align="right" nowrap><div align="left"><strong>
<input name="CodeStr" type="text" value="" size="20" maxlength="50" />
                      <%CBlogObj.Vcode%>
                      </strong></div></td>
                </tr>
                <tr>
                  <td width="179" align="right" nowrap><b>收件人：</b></td>
                  <td width="668" align="right" nowrap><div align="left"> 
                      <input name="UserName" type="text" id="UserName" value="<%=Request("UserName")%>" size="20" maxlength="50">
                      请输入收件人的用户名!</div></td>
                </tr>
                <tr>
                  <td align="right"><strong>消息内容：</strong></td>
                  <td align="right"><div align="left"> 
                      <textarea name="zy" cols="60" rows="4" id="zy"></textarea>
                      最多255个字符,多的将被截断!</div></td>
                </tr>
                <tr align="center">
                  <td></td>
                  <td><div align="left"> 
                      <input name="PostMessage" type="hidden" id="PostMessage" value="Post">
                      <input name="topicsubmit" type="submit" value="发送消息" onClick="copy()">
                    </div></td>
                </tr>
              </form>
            </table></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr> 
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr bgcolor="#0066CC" height="2"> 
    <td height="2"></td>
  </tr>
</table>
<!--#include file="Foot.asp" -->
