I needs your helps....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nasiruddin
Forum Newbie
Posts: 1
Joined: Thu Apr 14, 2005 10:03 pm
Contact:

I needs your helps....

Post 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....
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

ping will fail.

you may want to look into PEAR::Net_Ping
Post Reply