Código PHP:
<?php
flush();
$cmd = sprintf("./ping.sh %s", $host);
exec($cmd, $command_output);
?>
<script type="text/javascript">
document.getElementById("<?=$unique_id_loop?>").style.display = 'none';
</script>
<?
foreach($command_output as $r)
{
if( strstr($r, 'packets transmitted') == TRUE )
{
if( strstr($r, '0 received') == TRUE )
{
?>
<td style="border:1px solid black; background-color:red;">
<p>no responde</p>
<td>
<?php
}
else
{
?>
<td style="border:1px solid black; Background-color:green;">
<p>responde</p>
<td>
<?php
}
}
}
$command_output = "";
?>
Les re agradezco su respuesta!