<?
//-----------------------------------------------------------------------------
//    ID002同学录 单班级 (PHP & MySQL) 1.0 标准版
//-----------------------------------------------------------------------------
//    Copyright(C) aNErG, 2003. All rights reserved
//
//    技术支持 http://anerg.126.com
//-----------------------------------------------------------------------------
//    本软件对个人完全免费使用
//
//    如用于商业用途,您必须与我联系并支付RMB ￥20
//-----------------------------------------------------------------------------
if (!$HTTP_COOKIE_VARS["class_username"]){echo "请不要干坏事，谢谢合作！";exit;}
if($mod==""){
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>发送短消息</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body>
<form name="form1" method="post" action="<? echo "$PHP_SELF?mod=send"; ?>">
  <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="13%" valign="top">接收人: <br>
        <br>
        内&nbsp;&nbsp;容: </td>
      <td width="87%" valign="top"><input name="u2uto" type="text" value="<? echo "$u2u_to"; ?>" size="30"> 
        <br>
        <textarea name="u2uinfo" cols="29" rows="5"></textarea> 
        <input type="submit" name="Submit" value="提交"></td>
    </tr>
  </table>
</form>
</body>
</html>
<?php require("bottom.php"); 
 } 
 if($mod==send){
 include ('conn.php') ;
 require('function.php');
 $u2ufrom=$HTTP_COOKIE_VARS["class_username"];
 $u2uto=$HTTP_POST_VARS["u2uto"];
 $u2uinfo=$HTTP_POST_VARS["u2uinfo"];
 $u2uinfo=checkinfo($u2uinfo);
 $u2udate=date("y-m-j H:i:U");
 $u2uid=encrypt($u2udate);
 	 $query="insert into u2u values('$u2uid','$u2uto','$u2ufrom','$u2uinfo','$u2udate')";
	 $result=mysql_db_query("$dbname",$query);
 if(mysql_affected_rows()==0){
 echo "发送消息失败，请联系管理员！";exit;}else{
 echo "发送消息成功！";}
 ?>
 <head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>发送短消息</title>
<link href="css.css" rel="stylesheet" type="text/css">
<meta http-equiv=Refresh content="2; url=javascript:window.close()">
</head>
<?php require("bottom.php"); 
 } ?>