Home  >  Article  >  Backend Development  >  Using PHP and ACCESS to write a chat room (6)_PHP tutorial

Using PHP and ACCESS to write a chat room (6)_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:01:55704browse

leave.php3 :
    $ConnID=@odbc_connect("jtfcht","admin","");
    if ($ConnID){
        if (!($id=="1" && $ps="superldz")){
            $result=@odbc_exec($ConnID,"SELECT UserName,PassWord,RoomID,Sex FROM User WHERE UserID=".$id);
            if (@odbc_fetch_into($result,0,&$rArr)){
                if ($rArr[1]==$ps)
                    if ($rArr[3])
                        @odbc_exec($ConnID,"INSERT INTO ChtCont (sIDFrom, sNameFrom, sIPFrom, sIDTo, sNameTo, sTime, sCont, bSecret, RoomID) VALUES (".$id.", '".$rArr[0]."', '".getenv("REMOTE_ADDR")."', 0, '大家', '".date("H:i:s")."', '【系统消息】".$rArr[0]."离开了这个聊天室', False, ".$rArr[2].")");
                    else
                        @odbc_exec($ConnID,"INSERT INTO ChtCont (sIDFrom, sNameFrom, sIPFrom, sIDTo, sNameTo, sTime, sCont, bSecret, RoomID) VALUES (".$id.", '".$rArr[0]."', '".getenv("REMOTE_ADDR")."', 0, '大家', '".date("H:i:s")."', '【系统消息】".$rArr[0]."离开了这个聊天室', False, ".$rArr[2].")");
            }
            @odbc_exec($ConnID,"UPDATE User SET RoomID=0,ToID=0,ToName='',Secret=False,FirstTime=False,LstTime=0,LastLoc=0 WHERE UserID=".$id);
        }
        @odbc_close($ConnID);
    }
    header("Location: .");
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/316738.htmlTechArticleleave.php3 : ?php $ConnID=@odbc_connect(jtfcht,admin,); if ($ConnID){ if (!($id==1 $ps=superldz)){ $result=@odbc_exec($ConnID,SELECT UserName,PassWord,RoomID,Sex FROM User WHERE Use...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn