Well, after much digging around I discovered the
fsockopen function on PHP.NET and cobbled together this little snippet of code:
PHP Code:
$isThere = @ fsockopen("10.0.0.25", 135, $errno, $errstr, 10);
if (!$isThere) {
echo "Offline";
} else {
echo "Online";
}
It's not a true PING as PING doesn't really use a port, but
fsockopen requires a port to be specified. I used the infamous TCP port 135. The other parameters aren't required for this little snippet, but I left them there for completeness.
The other problem I had with this snippet was that if a PC is offline, I got a couple of PHP warnings that broke the display. Once again, Google to the rescue, I found that putting the "@" sign in front of the function suppressed the warnings. That was new one to me!