<?
echo '<html><head>
<title>myHOME Ethernet</title>
<link type="text/css" rel="stylesheet" href="global.css" />
</head><body><br/><br/>
<div id="c-div">
<div style="width: 800px; text-align: left;">
<p> <b>my</b>Home Ethernet </p><br/>
<img src="img/servicestarted.gif"/> > Mercury - Srv <br/>
';
$host = array ("192.168.1.3", "192.168.1.5", "192.168.1.7");
$name = array ("Roa - Blackout", "Rasha - Ash", "Dad - Father");
$countarray= count($host);
$httpport = "139";
for ($i=0; $i<$countarray; $i++) {
$fp = fsockopen( "$host[$i]", $httpport );
if ( !$fp ) {
echo " <img src=\"img/servicestopped.gif\"
alt=\"OFF\"/> > $name[$i] <br/>";
}else
echo " <img src=\"img/servicestarted.gif\"
alt=\"ON\"/> > $name[$i] <br/>";
}
echo '
<br/><br/><p>[<a href="index.php">return to home</a>]</p>
</div></div>';
?>
------------------------
Questo script apre dei socket verso le porte 139 (nmap le dava aperte)
e quindi un fallimento stampa a video una gif che indica lo stato di
spento ALTRIMENTI stampa a video una gif che indica lo stato di
acceso... notare che il server e messo OLTRE questo e che la porta
potrebbe variare per calcolatori con sistema operativo *nix like..
a presto