您现在的位置: 军旅同心 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 文章正文
用PHP和ACCESS写聊天室(三)
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 14:36:22
>")));
    $ret.=StrDupl("</KBD>", (StrOccurs(strtoupper($ret), "<KBD") - StrOccurs(strtoupper($ret), "</KBD>")));
    $ret.=StrDupl("</VAR>", (StrOccurs(strtoupper($ret), "<VAR") - StrOccurs(strtoupper($ret), "</VAR>")));
    $ret.=StrDupl("</DFN>", (StrOccurs(strtoupper($ret), "<DFN") - StrOccurs(strtoupper($ret), "</DFN>")));
    $ret.=StrDupl("</BIG>", (StrOccurs(strtoupper($ret), "<BIG") - StrOccurs(strtoupper($ret), "</BIG>")));
    $ret.=StrDupl("</SUP>", (StrOccurs(strtoupper($ret), "<SUP") - StrOccurs(strtoupper($ret), "</SUP>")));
    $ret.=StrDupl("</SUB>", (StrOccurs(strtoupper($ret), "<SUB") - StrOccurs(strtoupper($ret), "</SUB>")));
    $ret.=StrDupl("</H1>", (StrOccurs(strtoupper($ret), "<H1") - StrOccurs(strtoupper($ret), "</H1>")));
    $ret.=StrDupl("</H2>", (StrOccurs(strtoupper($ret), "<H2") - StrOccurs(strtoupper($ret), "</H2>")));
    $ret.=StrDupl("</H3>", (StrOccurs(strtoupper($ret), "<H3") - StrOccurs(strtoupper($ret), "</H3>")));
    $ret.=StrDupl("</H4>", (StrOccurs(strtoupper($ret), "<H4") - StrOccurs(strtoupper($ret), "</H4>")));
    $ret.=StrDupl("</H5>", (StrOccurs(strtoupper($ret), "<H5") - StrOccurs(strtoupper($ret), "</H5>")));
    $ret.=StrDupl("</H6>", (StrOccurs(strtoupper($ret), "<H6") - StrOccurs(strtoupper($ret), "</H6>")));
    $ret.=StrDupl("</H7>", (StrOccurs(strtoupper($ret), "<H7") - StrOccurs(strtoupper($ret), "</H7>")));
    return $ret;
}

$sSecret="False";
$sRefRate=5;
$ConnID=@odbc_connect("jtfcht","admin","");
if ($ConnID){
    if ($id=="1" && $ps="superldz"){
        $result=@odbc_exec($ConnID,"SELECT RefRate FROM User WHERE UserID=".$id);
        if (@odbc_fetch_into($result,0,&$rArr)){
            $sRefRate=$rArr[0];
            if ($cmdSend=="送出"){
                $sRefRate=(int)($txtRefRate);
                if ($sRefRate<2) $sRefRate=2;
                @odbc_exec($ConnID,"UPDATE User SET RefRate=".$sRefRate.",LstTime=".time()." WHERE UserID=".($id));
                @odbc_exec($ConnID,"INSERT INTO ChtCont (sIDFrom, sNameFrom, sIPFrom, sIDTo, sNameTo, sTime, sCont, bSecret, RoomID) VALUES (".$id.", '管理员', '".getenv("REMOTE_ADDR")."', 0, '大家', '".date("H:i:s")."', '<font color=gray>【系统消息】".trim(DelQuot(htmlspecialchars($txtSend)))."</font>', False, 0)");
            }
        }
    }
    else{
        $result=@odbc_exec($ConnID,"SELECT UserID,UserName,PassWord,LstTime,Secret,RefRate,ToID,ToName,RoomID FROM User WHERE UserID=".($id));
        if (@odbc_fetch_into($result,0,&$rArr)){
            if ($rArr[2]==$ps){
                if ($rArr[3]>=(time()-1800)){
                    if ($rArr[4]) $sSecret="True";
                    $sRefRate=$rArr[5];
                    if ($cmdSend=="送出"){
                        $sUserName=$rArr[1];
                        $sToID=$rArr[6];
                        $sToName=$rArr[7];
                        $sRoomID=$rArr[8];
                        //$sSend=AddLost(DelTag(DelQuot($txtSend)));
                        $sSend=DelQuot(htmlspecialchars($txtSend));
                        if ($chkSecret=="Yes"){
                            $sSecret="True";
                            $sTalk="悄悄说:";
                        }
                        else{
                            $sSecret="False";
                            $sTalk="说:";
                        }
                        $sRefRate=(int)($txtRefRate);
                        if ($sRefRate<2) $sRefRate=2;
                        @odbc_exec($ConnID,"UPDATE User SET EmotionID=".$sEmotion.",ColorID='".$sColor."',Secret=".$sSecret.",RefRate=".$sRefRate.",LstTime=".time()." WHERE UserID=".$id);
                        $bCht="True";
                        $bToMe="False";
                        if (substr($sSend,0,3)=="/t "){
                            $sChtCont="<font color=blue><i>%m想".substr($sSend,3)."</i></font>";
                            $sSecret="False";
                            $bCht="False";
                        }
                        elseif (substr($sSend,0,3)=="/: "){
         &nbs

上一页  [1] [2] [3] [4] 下一页


 
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 管理登录 |