【发布时间】:2015-10-18 02:24:45
【问题描述】:
我正在尝试制作脚本,我想显示从 URL 插入的游戏服务器 ip 的信息。
在当前配置中我有:
<?php
define( 'SQ_TIMEOUT', 1 );
define( 'SQ_ENGINE', SourceQuery :: SOURCE );
define( 'SQ_SERVER_ADDR', '123.45.67.890' );
define( 'SQ_SERVER_PORT', 12345);
?>
我试过这样:
<?php
define( 'SQ_TIMEOUT', 1 );
define( 'SQ_ENGINE', SourceQuery :: SOURCE );
if (isset($_GET['ip'])){
$ip = $_GET['ip'];
}
if (isset($_GET['port'])){
$port = $_GET['port'];
}
define( 'SQ_SERVER_ADDR', $ip );
define( 'SQ_SERVER_PORT', $port );
?>
变得像
http://localhost/".$ip.":".$port.
而不是固定的ip。插入“定义”
【问题讨论】: