<table border=0><tr><td bgcolor=litered width=100% colspan= "9" ><p align= "center" ><b> Server Health Immediate Display table </b><center>
<?php Tutorial
Set_time_limit (0);
Echo strftime ("%y year%m Month%d days");
?>
</td></tr>
<TR><TD bgcolor= "#cococo" >ip address </td><td bgcolor= "#cococo" > Detection time </td>
<TD bgcolor= "#cococo" >ftp </td>
<TD bgcolor= "#cococo" >telnet</td><td bgcolor= "#cococo" >smtp </td>
<TD bgcolor= "#cococo" >dns</td><td bgcolor= "#cococo" >http </td>
<TD bgcolor= "Cococo" >pop3</td><td bgcolor= "#cococo" >finger </td>
</td></center>
<?php
This program must start Php_sockets.dll
$port =array (22,23,25,53,80,110,79);
$filename = "Host.txt";
$FL =file ($filename);
for ($i =0; $i <count ($FL); $i + +) {
$a =preg_split ('///', $FL [$i]);
$name []= $a [0];
$IP []= $a [1];
$yn []= $a [2];
}
for ($j =0; $j <count ($FL); $j + +) {
echo "<tr><td bgcolor=yellow>
$name [$j]</td><td bgcolor=liteblue> ". Date (" H:i:s a ")." </td> ";
For ($i =0 $i <7; $i + +) {
if (substr ($yn [$j], $i, 1) = = "1") {
@ $result [$i]=fsockopen ($ip [$j], $port [$i], $serno, $ERRSTR, 1);
if ($result [$i]) {
echo "<td bgcolor=litegreen> normal </td>";
} else {
echo "<TD bgcolor=red> failure </td>";
}
} else {
echo "<td bgcolor=litegreen>n/a</td>";
}
}
echo "</tr>";
}
?>
<TR><TD Bgcolor=litegray width=100% colspan= "9" > Remark:<br>
1. This test table is the unit to the units of the simple server detection, does not mean that the server must be able to operate normally <br>
2.N/A representative not detected .<br></td></tr></table>