Ping from PHP with shell_exec comando in IIS 5 and windows XP

From: Date: Fri, 14 May 2004 01:44:29 +0000
Subject: Ping from PHP with shell_exec comando in IIS 5 and windows XP
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-23723@lists.php.net to get a copy of this message
Friends, I have a dude, I can´t do make a PING to a server using PHP and SHELL_EXEC command The following code that i use is this <!-- monitor.php --> <html> <head> <META HTTP-EQUIV="Refresh" CONTENT="60"> </head> <body> <h2>Monitoring de Servers</h2> <table border=1 cellspacing=3> <tr> <?php $servidores = array ( "server1.com" => "200.215.128.83", "server2.com" => "200.215.128.241" ); while (list($site,$ip) = each($servidores)) { $comando = "ping -n 1 " . $ip; $salida = shell_exec($comando); echo "<td>".$site."<br>".$ip."<br>"."Estado:"; if ( ereg("bytes of",$salida) ) { echo "<b>online</b></td>"; } else { echo "<font color=red><b>not in line</b></font></td>"; } } ?> </tr> </table> </body> </html> <!-- end --> In Advance , Thanks

« previous php.windows (#23723) next »