$output = shell_exec('ping -n 1 192.168.1.90'); echo "<pre>$output</pre>";
Pinging 192.168.1.90 with 32 bytes of data: Reply from 192.168.1.90: bytes=32 time<1ms TTL=64 Ping statistics for 192.168.1.90: Packets: Sent = 1, Received = 1, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms
<?php function ping($host, $port, $timeout) { $tB = microtime(true); $fP = fSockOpen($host, $port, $errno, $errstr, $timeout); if (!$fP) { return '<strong style="color: red;">failed</strong>'; } $tA = microtime(true); return '<strong style="color:green;">success in '.round((($tA - $tB) * 1000), 0).' milliseconds</strong>'; } ?> <p>Pinging 178.79.137.101... <? echo @ping("178.79.137.101", 80, 10); ?>.</p> <p>Pinging www.tehforum.co.uk... <? echo @ping("www.tehforum.co.uk", 80, 10); ?>.</p> <p>Verifying forum is online...<? if (strpos(strtolower(file_get_contents("http://www.tehforum.co.uk/forum")),'<title>teh forum</title>') !== false) { echo '<strong style="color:green;">success</strong>'; } else { echo '<strong style="color:red;">failed</strong>'; } ?>.</p>
Well I did quote the one I've used in the first post....
And thanks for Teh Backup code, I shall give that a go :D