|
|
|
รบกวนขอ code ตรวจสอบสถานะ server ว่า Online / Offline !!!!!!! |
|
|
|
|
|
|
|
Code (PHP)
/* Usage:
$status = GetServerStatus('http://domain.com',80)
or
$status = GetServerStatus('IPAddress',80)
*/
<?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];}
}
?>
|
|
|
|
|
Date :
2012-12-20 17:13:43 |
By :
ผ่านมา |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|