document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2. error_reporting(0);
  3.  
  4.   /** me@dwisiswanto.my.id **/
  5.   # usage; this.php domain/ip
  6.  
  7. function ping($host){
  8.     $starttime = microtime(true);
  9.     $exec = fsockopen($host, 80, $errno, $errstr, 5); // 80 = port; 5 = max. execution time
  10.     $stoptime = microtime(true);
  11.     $status = 0;
  12.  
  13.     if (!$exec) {
  14.         $status = "Request timed out.";
  15.     } else {
  16.         $status = ($stoptime - $starttime) * 1000;
  17.         $status = "Reply from " . $host . ": bytes=32 time=" . floor($status) . "ms TTL=53";
  18.     }
  19.     fclose($exec);
  20.     return $status;
  21. }
  22.  
  23. if (preg_match(\'/^[a-z]{2,6}+\\.[-a-z0-9]+\\.[a-z]{2,6}$|^[-a-z0-9]+\\.[a-z]{2,6}$/\', strtolower($argv[1]))) {
  24.     echo "\\nPinging " . gethostbyaddr(gethostbyname($argv[1])) . " [" . gethostbyname($argv[1]) . "] with 32 bytes of data:\\n";
  25.     while (true) {
  26.         echo ping(gethostbyname($argv[1])) . "\\n";
  27.         sleep(1);
  28.     }
  29. } elseif (preg_match(\'/^[0-9]{1,3}+\\.[0-9]{1,3}+\\.[0-9]{1,3}+\\.[0-9]{1,3}$/\', strtolower($argv[1]))) {
  30.     echo "\\nPinging " . $argv[1] . " with 32 bytes of data:\\n";
  31.     while (true) {
  32.         echo ping($argv[1]) . "\\n";
  33.         sleep(1);
  34.     }
  35. } else {
  36.     echo "Ping request could not find host " . $argv[1] . ". Please check the name and try again.";
  37. }
  38. ?>
');