Jump to content

Server Status Check Script


Shockdot

Recommended Posts

Hello, I made a server statuc checking script that checks the status of a game server. It works fine on my computer, but when I upload it to my web host it stops working. I'm assuming my web host is blocking it in some way. My host is Yahoo Small Businesses. Does anyone know if they block this kind of thing, or if there is a way to unblock it? Perhaps editing the code?

 

Here is my code, if that helps.

<?php
function GetServerStatus($site, $port)
{
	$status = array("OFFLINE", "ONLINE");
	$fp = @fsockopen($site, $port, $errno, $errstr, 2);
	if(!$fp)
	{
		return $status[0];
	}
	else 
	{
		return $status[1];
	}
}
$Redemption = GetServerStatus("174.142.118.233", 11661);
$RedemptionPossible = GetServerStatus("174.142.118.234", 51665);

$Tranquility = GetServerStatus("174.142.118.234", 11601);
$TranquilityPossible = GetServerStatus("174.142.118.234", 51665);

$Nemesis = GetServerStatus("174.142.118.241", 11601);
$NemesisPossible = GetServerStatus("174.142.118.241", 64721);

$OverallServer = GetServerStatus("174.142.118.237", 11093);
$CodServer = GetServerStatus("8.9.6.122", 4230);
echo($CodServer . "<br />");
echo("Overall Server: " . $OverallServer . "<br />");
echo("Redemption: " . $Redemption . "<br />");
echo("Tranquility: " . $Tranquility . "<br />");
echo("Nemesis: " . $Nemesis . "<br />");
?>

Link to comment
https://forums.phpfreaks.com/topic/233740-server-status-check-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.