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

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

WBOY
WBOYOriginal
2016-07-21 16:02:321177browse

enterrm.php3
代码如下:
        $ConnID=@odbc_connect("jtfcht","admin","");
        if ($ConnID){
                $result=@odbc_exec($ConnID,"SELECT PassWord,LstTime,RoomID,RefRate FROM User WHERE UserID=".$id);
                if (@odbc_fetch_into($result,0,&$rArr)){
                        $sRoomID=$rArr[2];
                        $sRefRate=(int)$rArr[3];
                        if ($sRefRate<2) $sRefRate=2;
                        if (($rArr[0]==$ps) && ($rArr[1]>=(time()-1800))){
                                $sNewRoomID=substr($selRoom,2);
                                if ($sNewRoomID!=$sRoomID){
                                        $result=@odbc_exec($ConnID,"SELECT Password FROM Room WHERE RoomID=".$sNewRoomID);
                                        if (@odbc_fetch_into($result,0,&$rArr)){
                                                if ((strlen(trim($rArr[0]))==0) || ($rArr[0]==$sPass)){
                                                        @odbc_exec($ConnID,"UPDATE User SET RoomID=".$sNewRoomID.",ToID=0,ToName='大家' WHERE UserID=".$id);
                                                        if ((int)$sRoomID!=1){
                                                                $result=@odbc_exec($ConnID,"SELECT COUNT(UserID) FROM User WHERE RoomID=".$sRoomID);
                                                                @odbc_fetch_into($result,0,&$rArr);
                                                                if ($rArr[0]==0) @odbc_exec($ConnID,"DELETE * FROM Room Where RoomID=".$sRoomID);
                                                        }
                                                }
                                                else{
?>


输入房间口令






 


输入房间口令




        
                
        
        
                
                
        
        
                
        
口令:


这里放弃




                                                        exit();
                                                }
                                                                                                                                                                                                                   through 🎜>
Error joining room





This room has been demolished!


Press herereturn




                                                                                                                                                                                                                                                                                              Since 'Content- Type' content='text/html; charset=gb2312'>room< ;/head>"; content='text/html; charset=gb2312'>room @odbc_close ($ connid);
}
Else Echo "& LT; HTML & GT ; & lt; head & gt; & lt; meta http -equiv='Content-Type' content='text/html; charset=gb2312'>room";
include("room.php3");
?>



[The copyright of this article is jointly owned by the author and Oso.com. If you need to reprint, please indicate the author and source]




http://www.bkjia.com/PHPjc/316516.html

www.bkjia.com

true

http: //www.bkjia.com/PHPjc/316516.html

TechArticle

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