用PHP和ACCESS写聊天室(八)_PHP教程

WBOY
发布: 2016-07-21 16:02:30
原创
887 人浏览过

emotion.php3:
代码如下:


表情动作




        $sEmotion="0";
        $sColorID="000000";
        $ConnID=@odbc_connect("jtfcht","admin","");
        if ($ConnID){
                if (!($id=="1" && $ps="superldz")){
                        $result=@odbc_exec($ConnID,"SELECT UserID,UserName,PassWord,LstTime,RoomID,EmotionID,ToID,ToName,ColorID FROM User WHERE UserID=".$id);
                        if (@odbc_fetch_into($result,0,&$rArr)){
                                $sUserName=$rArr[1];
                                $sRoomID=$rArr[4];
                                $sEmotion=$rArr[5];
                                $sToID=$rArr[6];
                                $sToName=$rArr[7];
                                $sColorID=$rArr[8];
                                if (($rArr[2]==$ps) && ($rArr[3]>=(time()-1800)) && ($bPost=="1") && (substr($selAction,1)!="None")){
                                        odbc_exec($ConnID,"UPDATE User SET EmotionID=".$selEmotion.",ColorID='".$selColor."',LstTime=".time()." WHERE UserID=".$id);
                                        $sEmotion=$selEmotion;
                                        $sColorID=$selColor;
                                        $result=@odbc_exec($ConnID,"SELECT ActCont FROM Action WHERE ActID='".substr($selAction,1)."'");
                                        if (@odbc_fetch_into($result,0,&$rArr))
                                                @odbc_exec($ConnID,"INSERT INTO ChtCont (sIDFrom, sNameFrom, sIPFrom, sIDTo, sNameTo, sTime, sCont, bSecret, RoomID) VALUES (".$id.", '".$sUserName."', '".getenv("REMOTE_ADDR")."', ".$sToID.", '".$sToName."', '".date("H:i:s")."', '".trim($rArr[0])."', False, ".$sRoomID.")");
                                }
                        }
                }
?>


        if ($id=="1" && $ps="superldz"){
                echo "t绠$
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板