⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 submit.php

📁 中国象棋online web版的线上棋牌游戏。 能建房间
💻 PHP
字号:
<?php
include "./functions.php";
include "./dbconnect.php";

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

$chess_explode = explode(",", $chess);

for($c = "", $i = 0;$i < sizeof($chess_explode);$i ++)
{
	$new_chess = $chess_explode[$i];
	if($i + 1 == $_GET[from])
	$new_chess = "blank";
	if($i + 1 == $_GET[to])
	{
		if($chess_explode[$i] != "blank")
		$eated = $chess_explode[$i];
		$new_chess = $chess_explode[$_GET[from] - 1];
	}
	
	$c .= $new_chess.",";
}

if($_GET[site] == guest)
$flag = host;
else
$flag = guest;

mysql_query("update `room` set `chess` = '$c', `flag` = '$flag', `moved` = '".$_GET[from].",".$_GET[to]."', `eated` = '$eated' where `ID` = '".$_GET[roomid]."' limit 1");
?>

⌨️ 快捷键说明

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