用PHP和ACCESS写聊天室(九)-php教程
转载自:互联网 作者:cd3c.com
您正在看的php教程是:用PHP和ACCESS写聊天室(九)。 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;
$sRefRate=(int)$rArr;
if ($sRefRate<2) $sRefRate=2;
if (($rArr[0]==$ps) && ($rArr>=(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
[1] [2] [3] [4] 下一篇
