Advertisement
bu2chlc

ping utility

Jan 9th, 2020
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1.         <?php
  2.           function pingAddress($ip) {
  3.   $pingresult = exec("/bin/ping -c2 -w2 $ip", $outcome, $status);  
  4.   if (isset ($_POST['ipaddy'])) {
  5.   if ($status==0) {
  6.     echo '<div class="" role="alert">';
  7.       echo $ip .  " is alive";
  8.     echo '</div';
  9.     } else {
  10.       echo $ip .  " is dead";
  11.     }
  12.     return $status;
  13. } echo '<div class="" role="alert">';
  14.   echo "no ip selected";
  15. echo "</div>";}
  16. pingAddress($_POST['ipaddy']);
  17.           ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement