Page 1 of 1

I needs your helps....

Posted: Thu Apr 14, 2005 10:16 pm
by nasiruddin
I want to use the exec code in PHP. What i want to is pingging the computer IP Address and also the computers in my network, then the result will be displayed in browser, either the IP is exist or not. Below is my code :

Code: Select all

<?php 

if (isset($_POST[ip]))
{
	$qq = $_POST[ip];
	
	$lari = "ping " . $qq ;
	$aa = exec($lari);
	
	echo "IP " . $qq . " is exist"; 

}

else
{
?>

<html>
<head>
<title>For testing Only</title>
<h1>Pingging IP</h1>
</head>
<body>

Please enter the IP 
<form name="ip" method="post" action="index.php">
<input type="text" name="ip">
<input type="submit" value="Enter">
</form>

</body>
</html>
<? } ?>
My problem is also in how to determine the the IP is exist or not. Which code that can be used to do that???..

Thanks advanced....

Posted: Thu Apr 14, 2005 11:02 pm
by feyd
ping will fail.

you may want to look into PEAR::Net_Ping