yeah!
finally I put this code:

Code:
<?php
$str = exec("ping -n 1 -w 1 100.100.100.100", $input, $result);
if ($result == 0){
echo "<img src=\"on.png\">";
}else{
echo "<img src=\"off.png\">";
}
?>
It's run correctly, but i would like to insert this code into a javascript function because I insert many times this PHP and the page is very hard to load.
I would like to insert a button:

Code:
<input type="submit" onClick="para();">
and when I press this button, the javascript runs.
Is it possible??