当前位置:Gxlcms > PHP教程 > 用PHP和ACCESS写聊天室(九)_PHP教程

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

时间:2021-07-01 10:21:17 帮助过:2人阅读

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{
?>


输入房间口令







输入房间口令



按&ps=&at=">这里放弃




exit();
}
}
else{
?>


加入房间出错





这个房间已经被拆了!


按&ps=&at=">这里返回




exit();
}
}
}
else echo "房间";
}
else echo "房间";
@odbc_close($ConnID);
}
else echo "房间";
include("room.php3");
?>



【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/316516.htmlTechArticleenterrm.php3 代码如下:

?php $ConnID=@odbc_connect(jtfcht,admin,); if ($ConnID){ $result=@odbc_exec($ConnID,SELECT PassWord,LstTime,RoomID,RefRate FROM User WHERE UserID=.$id); i...

人气教程排行