join.php

来自「中国象棋online v2008 build 0313 web版的线上棋牌」· PHP 代码 · 共 20 行

PHP
20
字号
<?php
include "./functions.php";
include "./dbconnect.php";

$query = mysql_query("select * from `room` where `ID` = '".$_GET[roomid]."'");
$guest = mysql_result($query, 0, guest);
$host = mysql_result($query, 0, host);

if(($guest == '' && $host == '') || $host == '')
{
	mysql_query("update `room` set `host` = '$username',`time_host` = '".time()."',`time` = '".time()."' where `ID` = '".$_GET[roomid]."'");
}elseif($host != '' && $guest == ''){
	mysql_query("update `room` set `guest` = '$username',`time_guest` = '".time()."',`time` = '".time()."' where `ID` = '".$_GET[roomid]."'");
}else{
header("location:index.php");
exit;
}
header("location:room.php?id=".$_GET[roomid]);
exit;
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?