↑ Return to Testovi

Ping test

$max_count)
{
echo ‘Maximum for count is: ‘.$max_count;
echo ‘Back‘;
}
else
{
// replace bad chars
$host= preg_replace (“/[^A-Za-z0-9.-]/”,””,$host);
$count= preg_replace (“/[^0-9]/”,””,$count);
echo ”;
echo(“Ping:”);
echo ‘

';
      //check target IP or domain
      if ($unix)
      {
         $lastline=system ("ping -c {$count} {$host}",$retval);
//         print ($host." - ".$lastline." ".$retval);
         system("pkill ping");// kill all ping processes in case there are some stalled ones or use echo 'ping' to execute ping without shell
      }
      else
      {
         system("ping -n $count $host");
      }
      echo '

‘;
}
}

?>

Leave a Reply