代码:<?php 
     include "../global.php";//连接数据库
$dbconnect=user(3);
$connect=$dbconnect[0];
  include("conf/config.php");
    if($msg)
  {
   $msql="SELECT * FROM $def_user_table where id='$id' and on_line=1";
$DB_set=new DB_Oracle_Sql($connect,$msql);
if($DB_set->next_record()){
$chat_text_color=$DB_set->Result("TEXT_COLOR");
$chat_snick=$DB_set->Result("NICK");
}else{
echo "<script>window.alert('您被主持人请出了聊天大厅,不能再发表问题,如果想继续发表问题,请重新登陆!')</script>";
exit;
}
$DB_set->freeStatement();

//$msg = htmlspecialchars($msg);
$msg=str_replace("?","?",$msg);
$msg=str_replace(".","。",$msg);
$msg=str_replace("'","’",$msg);

$msql1="INSERT INTO $def_msg_table (SID,RID,TPTR,MID,MSG,SNICK,COLOR,SDATE,STIME)
 values('$id','0','$def_timestamp','1','$msg','$chat_snick','$def_base_color[$chat_text_color]','$def_date','$def_time')";
$DB_set1=new DB_Oracle_Sql($connect,$msql1);
$DB_set1->freeStatement();
}
?><?php 
    $msql6="SELECT max(tptr) FROM ".$def_msg_table." ";
$DB_set6=new DB_Oracle_Sql($connect,$msql6);
$DB_set6->next_record();
    $counter=$DB_set6->Result(1);
if($counter==0) $counter=1;
if($counter>$counter_old){
echo "
  <script>
parent.show.document.open();
parent.show.document.writeln(\"<html><head>\");
parent.show.document.writeln(\"<style type=text/css>\");
parent.show.document.writeln(\".p9 {  font-size: 9pt}\");
parent.show.document.writeln(\"body { font-family:'verdana', 'arial', 'helvetica', 'Tahoma'; font-size: 9pt; color:#000000;\");
parent.show.document.writeln(\"scrollbar-face-color:'eeeeee';\");
parent.show.document.writeln(\"scrollbar-shadow-color:'eeeeee'; \");
parent.show.document.writeln(\"scrollbar-highlight-color:'eeeeee'; \");
parent.show.document.writeln(\"scrollbar-3dlight-color:'f7f7f7'; \");
parent.show.document.writeln(\"scrollbar-darkshadow-color: '808080'; \");
parent.show.document.writeln(\"scrollbar-track-color:'ffffff'; \");
parent.show.document.writeln(\"scrollbar-arrow-color:'808080' }\");
parent.show.document.writeln(\"a:visited {color: #0000FF; text-decoration: none}\");
parent.show.document.writeln(\"a:link {  color: #0000FF; text-decoration: none}\");
parent.show.document.writeln(\"a:hover { color: #FF0000}\");
parent.show.document.writeln(\"</style>\");
parent.show.document.writeln(\"<script>function chatScroll(){\");
parent.show.document.writeln(\"if(parent.form.document.all.show_msg.checked){\");
parent.show.document.writeln(\"this.scroll(0,9999999);\");
parent.show.document.writeln(\"timeID=setTimeout('chatScroll()',100);\");
parent.show.document.writeln(\"timeRun=true;\");
parent.show.document.writeln(\"}}\");
parent.show.document.writeln(\"chatScroll();\");
parent.show.document.writeln(\"function insert(str_msg,str_no) {\");
parent.show.document.writeln(\"parent.msg.form.msg1.value=str_msg;\");
parent.show.document.writeln(\"parent.msg.form.no.value=str_no;\");
parent.show.document.writeln(\"}\");
parent.show.document.writeln(\"<\/script>\");
parent.show.document.writeln(\"<p style='word-spacing: 2; line-height: 150%; '>\");
</script>
";
$msql2="SELECT * FROM ".$def_msg_table."  order by no";
$DB_set2=new DB_Oracle_Sql($connect,$msql2);

while ($DB_set2->next_record()):

if($DB_set2->Result("MID") == "3")  {
echo "<script>parent.show.document.writeln(\"【<font color=#ff0000>主持人</font>】<b>".$DB_set2->Result("SNICK")."</b>  ".$DB_set2->Result("MSG")."<br> \")</script>";
}
if($DB_set2->Result("MID") == "4")  {
echo " <script>parent.show.document.writeln(\"【<font color=#ff0000>进站</font>】<b>".$DB_set2->Result("SNICK")."</b> ".$DB_set2->Result("MSG")." <br> \")</script>";
}
if($DB_set2->Result("MID") == "5")  {
echo "<script>parent.show.document.writeln(\"【<font color=#ff0000>出站</font>】 <b>".$DB_set2->Result("SNICK")."</b> ".$DB_set2->Result("MSG")." <br> \")</script>";
}
if($DB_set2->Result("MID") == "7")  {
echo "<script>parent.show.document.writeln(\"【<font color=#ff0000>离开</font>】 <b>".$DB_set2->Result("SNICK")."</b>".$DB_set2->Result("MSG")."<br> \")</script>";
}
if($DB_set2->Result("MID") == "1")  {
echo "<script>parent.show.document.writeln(\"【 <b>".$DB_set2->Result("SNICK")."  提问</b> 】 <font color=".$DB_set2->Result("COLOR").">".$DB_set2->Result("MSG")."</font> <font color='#ff0000' size=1>".$DB_set2->Result("STIME")."</font><br>\")</script> ";
}

endwhile;
$DB_set2->freeStatement(); }

echo "<meta http-equiv=refresh content=".$def_time_reload_user.";url=show_fresh.php?counter_old=".$counter.">";?>谢谢?