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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux