You are here: Simple Ping Tool - Display Each Line « PHP Programming Language « IT news, forums, messages
Simple Ping Tool - Display Each Line

Posted by Matt F on 05/25/07 16:16

I'm creating simple ping script that prompts a user for various
parameters.

However, I would like each line of the ping displayed as it
is received. Currently, the result isn't displayed until the ping is
finished.

<?php

$ping_ip_addr = $_GET['Host'];
$ping_count = $_GET['Count'];
$ping_size = $_GET['Size'];

$result = explode("\n", `ping -c $ping_count -s $ping_size
$ping_ip_addr`);

print "<pre>";

foreach($result as $val) {
print "$val<br>";
}

print "</pre>";

?>

<font face="verdana" size="2"><form action="<?php echo
$_SERVER['PHP_SELF']; ?>" method="GET">
IP Address: <input type="text" name="Host" />
Count: <input type="text" name="Count" value="5" />
Size: <input type="text" name="Size" value="32" /?
<input type="submit" value="Ping Host" name="Submit" />
</form>

Matt Florido

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация