Advertisement
Guest User

status

a guest
Sep 11th, 2013
745
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2. $host = 'localhost';
  3. $port = 8085;
  4.  
  5. function realm_status(){
  6.     global $host, $port;
  7.     $status = @fsockopen($host, $port, $error_no, $error_str, (float) 0.5);
  8.     if ($status){
  9.         @fclose($status);
  10.         return true;
  11.     }else
  12.         return false;
  13. }
  14.  
  15. if (realm_status())
  16.     $value .= '<font color=\'green\'><b>Включен</b></font>';
  17. else
  18.     $value .= '<font color=\'red\'><b>Выключен</b></font>';
  19.  
  20. print "<h3 align=\"center\">Статус сервера: $value</h3>";
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement