SimplePortal
Customization => Custom Coding => Topic started by: mons00n on November 05, 2010, 05:57:03 PM
-
We're running SMF 2.0 RC4 and up until today was running SP 2.3.2, which is now updated to 2.3.3
We had a small PHP script to check if a server was online or not that worked fine in a custom php block:
<?
function servstat($name, $host, $port) {
?>
<tr>
<td> <?echo($name); ?> </td>
<td> - </td>
<?
@$socket = fsockopen($host, $port,$errno,$errstr,5);
if(!$socket) {
?> <td> <b> <font color = "red"> Offline! </font> </b> </td><?
} else {
fclose($socket);
?> <td> <b> <font color = "green"> Online! </font> </b> </td><?
}
?> </tr> <?
}
?> <table border = "0" align="center">
<?
servstat("MC Server", "IPADDRESS",PORT);
servstat("Vent Server", "IPADDRESS",PORT);
?> </table>
which worked fine, but after the update it only shows a blank box. Does anyone have any ideas why this stopped working after the update of SP? Thanks for your time!
-
Use "<?php" not "<?".
-
thanks for dealing with my php ignorance =)
worked like a charm!