聊天室php&mysql(四)
2008-02-15 17:59:36 来源:WEB开发网核心提示: $sql="select id from chat_user_list where userid='$usert1'"; $result=MySQL(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)
$sql="select id from chat_user_list where userid='$usert1'";
$result=MySQL(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)_error());
$rowt1=MySQL(和PHP搭配之最佳组合)_fetch_array($result);
$usert5=$rowt1["id"];
$sql="select id from chat_user_list where userid='$objectt1'";
$result=MySQL(和PHP搭配之最佳组合)_query($sql)or die(MySQL(和PHP搭配之最佳组合)_error());
if($rowt2=MySQL(和PHP搭配之最佳组合)_fetch_array($result))
$bojectt5=$rowt2["id"];
else $bojectt5="大家";
if($row["userid"]!=$userid){
$user1="<a href='".$PHP_SELF."?userid=$userid' onClick=parent.bottom.user('".$usert5."')>".$usert5."</a>";
}
else $user1=$usert5;
if($row["object"]!=$userid){
$user2="<a href='".$PHP_SELF."?userid=$userid' onClick=parent.bottom.user('".$bojectt5."')>".$bojectt5."</a>"; }
else $user2=$bojectt5;
$message2=$row["message"];
$message3=htmlspecialchars($message2);
$message1="<font size=3 color=".$row["color"]."><i>".$user1."</i> 对".$user2." <i>".$row["action1"].": </i>".$message3."</font>" ;
if($row["status"]==1){
if($row["object"]==$userid||$row["userid"]==$userid)
echo "<font size=2 color=ff0000 >私聊</font>".$time1." ".$message1."<br>";
else continue;
}
else {
echo $time1." ".$message1."<br>";
}
}
?>
</body>
</html>
更多精彩
赞助商链接