<html> <head> <meta http-equiv=Content-Type content="text/html;charset=windows-1251"> </head> <table width=500 height=500 border=0> <tr> <td valign=top> <br><br><br> <center> <font color=red><b>Статус сервера:</b></font> <br><br> <? error_reporting(0); $IP = array( "FTP: " => "192.168.1.2:5555", "Irc: " => "192.168.1.2:4444", ); while(list($ServerName,$Host)=each($IP)) { list($IPAddress,$Port)=explode(":",$Host); echo($ServerName); if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)) { echo("<font color='green'>On-line </font><br>"); fclose($fp);} else { echo ("<font color='red'>Off-line </font><br>");}} ?> </center> </td> </tr> </table> </body> </html>