Menthix
forum admin
Posts: 5537 Reputation: 102
40 / /
Joined: Mar 2002
|
RE: is the server online using php
Try this:
code: <?
$ip = "http://247.212.233.220"; // IP Here
$port = 8000; // Port Here
if(fsockopen($ip, $port, $errno, $errstr, '10')) {
echo "The server is <font color='green'>Online</font>!";
} else {
echo "The server is <font color='red'>Offline</font>!<br/>";
echo "Returned error: ".$errstr." (code ".$errno.")";
}
?>
This post was edited on 06-05-2008 at 09:33 AM by Menthix.
|
|