Jump to content

[SOLVED] Ping server from PHP


Nil

Recommended Posts

you could also try.

 

<?php
$_ip = $_SERVER['REMOTE_ADDR'];
echo "<b>Enter the IP or the domain name of the server that you are trying to ping.</b><br>";
echo "<form method='post' action='ping.php?do=ping'><input type='text' name='domain' class='input_login' value='$_ip'> <input type='submit' value='Ping' class='input_login'></form>";
if($_GET['do'] == 'ping')
{
$_domain = $_POST['domain'];
	echo "<pre>";
                   system ("ping -w 10 -c 5 $_domain");

  		echo "</pre>";
}
echo "<br>";
?>

 

Regards ACE

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.