首頁 >後端開發 >php教程 >用PHP和ACCESS寫聊天室(七)_PHP教學

用PHP和ACCESS寫聊天室(七)_PHP教學

WBOY
WBOY原創
2016-07-21 16:02:47894瀏覽

chtcont.php3:
代碼如下:
        $sCont="";
        $ConnID=@odbc_connect("jtfcht","admin","");
> if($ connid){
> if($ id ==“ 1” && $ ps =“ superldz”){
$ result =@odbc_exec($ connid,$ connid,'選擇25 Stime,Scont,Scont,Scont, sNameFrom,sNameTo,SeqID,sIPFrom FROM ChtCont ORDER BY SeqID DESC");
                              while (@odbc_fetch _into($結果,0,&$rArr ) ){
                            地 ".$rArr[1]; );
                              =str_replace("%g",$rArr[3],$sLine);
                                         if ($rArr[4]>$ l 最大) $l 最大=$ rArr[4] ;
                                      }
                       )。
                else{為
             stTime、LstTime、RoomID WHERE UserID=".$id);
                                                                              if ($rArr[3]>=(時間()-1800)){
if ($rArr[2]){
                               $result=@odbc_exec($ConnID,"從ChtCont 選取前25 個sTime,sCont,sNameFrom,sIDFrom,sNameTo,sIDTo,SeqID WHERE (bSecret=False OR (bSecret =True AND (sIDFrom=".$id." OR sIDTo=".$id." OR sIDTo=0))) AND (RoomID=".$rArr[4]." OR RoomID=0) 依SeqID DESC 排序");
                                 $lMax=-1; (@odbc_fetch_into($result,0,&$rArr)){
                                         $sLine=$rArr[0]." ".$rArr[1 ];
                                      if ($id==$rArr[3])
                                               $sLine=str_replace("%m","你",$ );                                                                        ( "%m",$rArr[2],$sLine);
                                                                if ($id==$rArr[5])
                                            $sLine=str_replace("%g","你",$sLine);
                                  其他
                                                          $sLine=str_replace("%g",$rArr[4],$sLine);
                                     $sLine.="
n";
                                   if ($rArr[6]>$lMax) $lMax=$rArr[6];
                                      $sCont=$sLine.$sCont;
                                                                      exec($ConnID,"更新使用者設定 FirstTime=False,LastLoc=".($lMax 1)." WHERE UserID=".$id);
                                                                    }
                                href='.' target='_top'>這裡重新登入

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn