Liens divers
// --------------- code ping ------------------- function test() { // variables $retval=0; $cmd = "ping -c1 -q "; $machine = array('Marc' => 'com010', 'Gros' => 'com02', 'Scalzo' => 'ia7', 'Nico' => 'cinema01'); reset($machine); // Run command while (list($key, $val) = each($machine)) { echo "$key"; $finalCmd=$cmd.$val; exec ($finalCmd, $command_output, $retval); printResult($retval); } } function printResult($val){ if($val != 0) echo " est là"; else echo " dort encore...
"; } ?>
Ping
Digg
Whois
$status = $_GET['status']; $host = $_GET['host']; $host = trim($host); $host = strtolower($host); $ip = $_SERVER['REMOTE_ADDR']; $self = $_SERVER['PHP_SELF']; $fulltext=" "; // Is form submitted ? if ( $status == "whois" ) { // check if it is a valif IP or host format if( !(ereg("^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$", $host)) AND !(ereg("[a-z0-9\-\_.]+\.[a-z]{2,5}$", $host))) { echo ''; echo " $host does not appear to be valid "; echo ''; echo '