晚上所有,
我有一个重新编程问题,希望得到一些帮助
<div style="width:800px;height:100px;border:2px solid black;">
<html>
<body>
<br>
<?php
mysql_connect("localhost", "user", "password!") or die (mysql_error());
#echo "Connected to MYSQL ";
mysql_select_db("starforg_search") or die (mysql_error());
#echo "Connected to Data Base";
$query = "SELECT * FROM addserver";
$result = mysql_query ($query) or die (mysql_error());
while ($row = mysql_fetch_array($result)) {
$value = $row['servername'];
$value2 = $row['serveraddress'];
$value3 = $row['portnumber'];
$value4 = $row['description'];
}
?>
Server Name :<?php echo $_POST[$value1]; ?>
Server Address : <?php echo $_POST[$value2]; ?>
Port Number : <?php echo $_POST[$value3]; ?>
<br>
<br>
Server Description : <?php echo $_POST[$value4]; ?>
<br>
<br>
// Script by Akensai
<?php
$ip = $_POST[$value];
$port = $_POST[$value2];
if (!$socket = @fsockopen($ip, $port, $errno, $errstr, 30))
{
echo " <font color='red'><CENTRE><strong>Server Is Offline!</strong></CENTRE></font>";
}
else
{
echo " <font color='green'><CENTRE><strong> Server Is Online!</strong></CENTRE></font>";
fclose($socket);
}
?>
<p> Server status is updated every hour</p>
<br>
</body>
</html>
</div>
这是输出
不用说,我希望将 PHP 脚本中的值添加到 HTML 字段中
如果我只是回显并从 Mysql 调用 PHP 值,它工作正常,所以我必须有一些 HTML 语法错误,请尽可能纠正。
谢谢你的时间
本