nateshoffner

PHP Ping

Apr 14th, 2012
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.14 KB | None | 0 0
  1. <?php
  2. $str = exec("ping -n 1 -w 1 63.143.39.62", $output, $result);
  3.  
  4. if ($result == 0)
  5. {
  6.     echo 'on';
  7. }
  8.  
  9. else
  10. {
  11.     echo 'off';
  12. }
  13. ?>
Advertisement
Add Comment
Please, Sign In to add comment