What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » [PHP] Getting the online status of a computer [SOLVED]

[PHP] Getting the online status of a computer [SOLVED]
Author: Message:
ryxdp
Senior Member
****


Posts: 804
Reputation: 16
29 / Male / Flag
Joined: Jun 2006
O.P. [PHP] Getting the online status of a computer [SOLVED]
Well, I've Googled how to do this a bit and found no efficient way to do it. What I would like is something that pings a computer on the local network using a predefined address/name etc., and if it can be reached, return "foobar". It'll be running on a Windows-based fileserver, on a page that shows shared folders and computers on the network.

Thanks :P

EDIT: I figured out what was wrong with the ping command I already had:

PHP code:
function pingcomputer($name){
    exec('ping -n 1 '.$name.' 2>&1',$output,$result); // was -c 1 instead of -n 1 which is what windows uses
    if($result==0){
        return '<img src="online.png" title="Online" alt=""/>';
    }else{
        return '<img src="offline.png" title="Offline" alt=""/>';
    }
}


This post was edited on 10-23-2009 at 08:39 PM by ryxdp.
10-23-2009 09:34 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[PHP] Getting the online status of a computer [SOLVED] - by ryxdp on 10-23-2009 at 09:34 AM
RE: [PHP] Getting the online status of a computer - by John Anderton on 10-23-2009 at 10:05 AM
RE: [PHP] Getting the online status of a computer - by Jarrod on 10-23-2009 at 12:26 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On