PHP קוד:
$http=$row["http"];
$ftp=$row["ftp"];
$other=$row["other"];
$port=$row["portother"];
//chek http online
if($http == "")
{
echo"http לא ניבחר";
}
else
{
$httpsock = fsockopen("$http", 80);
if($httpsock)
{
echo "Online";
}
else
{
echo "Offline";
}
}
//chek ftp online
if($ftp == "")
{
echo"ftp לא ניבחר";
}
else
{
$ftpsock = fsockopen("$ftp", 21);
if($ftpsock)
{
echo "<br>Online";
}
else
{
echo "<br>Offline";
}
}
//chek other tihng online
if($other || $port == "")
{
echo "<br>לא ניבחר בדיקת זמינות אחרת";
}
else
{
$othersock = fsockopen($other,$port, $errno, $errstr, 30);
//$othersock = fsockopen($other, $port);
if($othersock)
{
echo "<br>Online";
}
else
{
echo "<br>Offline";
}
}
}