Created
February 19, 2012 21:32
-
-
Save acidtib/1865914 to your computer and use it in GitHub Desktop.
Check if wow server is running
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$host = '173.192.81.52'; | |
$ports = array(8085); | |
foreach ($ports as $port) | |
{ | |
$connection = @fsockopen($host, $port); | |
if (is_resource($connection)) | |
{ | |
echo '<h2>' . $host . ':' . $port . ' ' . '(' . getservbyport($port, 'tcp') . ') is open.</h2>' . "\n"; | |
fclose($connection); | |
} | |
else | |
{ | |
echo '<h2>' . $host . ':' . $port . ' is not responding.</h2>' . "\n"; | |
} | |
} | |
?> |
Great, thanks!
test is and let me know if it works
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the $ports array you can use multiple ports, like 8085, 80, 21