"blue9" colspan="2">
<?php
$result = mysql_query("SELECT * FROM privatenote where touser='$userregister' ORDER BY time DESC",$db);
$row=mysql_num_rows($result); //悄悄话总数
$unlook=0;
if (!$row==0){
for ($i=0;$i<$row;$i++){
$id=mysql_result($result,$i,'id');//留言id
$fromuser=mysql_result($result,$i,'fromuser');//留言人姓名
$time=mysql_result($result,$i,'time'); //留言时间
$message=mysql_result($result,$i,'message'); //留言内容
$look_s="已看过"; //注释
$look=mysql_result($result,$i,'look'); //是否看过
if ($look=="0"){$unlook++;$look_s="尚未看过";} //计算未看过的悄悄话数目,并改变注释
mysql_query("UPDATE privatenote SET look='1' where id='$id'",$db); //将悄悄话看过状态改为1
echo "第",$i+1,"条 发出人:",$fromuser," 留言时间:",$time,"<BR>";
echo " 留言内容:",$message,"<BR>------",$look_s;
echo "<a href='$PHP_SELF?del=1&id=$id'>删除</a><HR>";
}
}
echo "悄悄话总数:",$row,".",$unlook,"条新悄悄话.";
?>
</td>
</tr>
<tr>
<td class="black10" colspan="2">
<form method="post" action="<?php echo $PHP_SELF;?>">
<p align="center">您要给谁发悄悄话?
<select name="yname">
<?
$result = mysql_query("SELECT * FROM user",$db);
$row=mysql_num_rows($result); //成员人数
for ($i=0;$i<=($row-1);$i++){
$name=mysql_result($result,$i,'name'); //姓名
echo "<option>",$name,"</option>";
}
mysql_close($db);
?>
</select>
<br>
留言内容:<br>
<textarea name="ynote" cols="60" rows="6"></textarea>
<br>
<b>
<input type="submit" name="Submit" value="确认">
</b>
<input type="reset" name="cancel" value="重写">
</p>
</form>
</td>
</tr>
</table>
</BODY>
</HTML>
上一页 [1] [2]