Re: Hacer ping y mostrarlo en nueva ventana
| From: | Ezequiel Suarez | Date: | Mon, 29 May 2006 13:36:33 +0000 |
| Subject: | Re: Hacer ping y mostrarlo en nueva ventana | ||
| References: | 1 2 3 4 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-58964@lists.php.net to get a copy of this message | ||
Fernando hice lo siguiente y no me funciono, puede ser que haya algun error?
Este es el script ping.php
<html>
<head>
<title>Referencias</title>
</head>
<body>
<?php
$comm = "ping -c ".$_REQUEST['ping'];
$output shell_exec($comm);
echo "<pre>$output</pre>";
?>
</body>
</html>
Y este es un fragmento del otro script
for ($i=0; $i <$num_results; $i++)
{
$row = $result->fetch_assoc();
echo '<tr><td><font face="Trebuchet MS" size="2"
color="#000000">';
echo '<a href="genera_reclamos.html?Referencia='.$row
['Referencia'].'">'.$row['Referencia'].'</a>';
echo '</td></font><td><font face="Trebuchet MS"
size="2"
color="#000000">';
echo $row['Sucursal'];
echo '</td></font><td><font face="Trebuchet MS"
size="2"
color="#000000">';
echo $row['Nombre_de_Sucursal'];
if ($row['Estado']=='Baja')
{
echo '</td></font><td><font face="Trebuchet
MS"
size="2" color="#FF0000">';
}
else
{
echo '</td></font><td><font face="Trebuchet
MS"
size="2" color="#000000">';
}
echo $row['Estado'];
echo '</td></font><td><font face="Trebuchet MS"
size="2"
color="#000000">';
echo $row['Vinculo'];
echo '</td></font><td><font face="Trebuchet MS"
size="2"
color="#000000">';
echo $row['Servicio'];
echo '</td></font><td><font face="Trebuchet MS"
size="2"
color="#339966"">';
$ip = $row['Ip'];
echo "<a href='ping.php?ip=$ip'>$ip</a>";
echo '</td></font><td><font face="Trebuchet MS"
size="2"
color="#000000">';
echo $row['Telefono'];
echo '</td></font><td>';
}
echo '</td></tr>';
echo '</table>';
$result->free();
$db->close();
?>
</body>
</html>