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
John Anderton
Elite Member
*****

Avatar

Posts: 3908
Reputation: 80
37 / Male / Flag
Joined: Nov 2004
Status: Away
RE: [PHP] Getting the online status of a computer
use file_get_contents to get a file listing from it.. run apache on the remote machine.
If you get the page, its working fine. If you can't then you're not online :)

I do something similar (but with a lot more complicated rule set+code) to handle my ISP's internet rules. :)
[

KarunAB.com
]

[img]http://gamercards.exophase.com/459422.png[
/img]
10-23-2009 10:05 AM
Profile E-Mail PM Web Find Quote Report
Jarrod
Veteran Member
*****

Avatar
woot simpson

Posts: 1304
Reputation: 20
– / Male / Flag
Joined: Sep 2006
RE: [PHP] Getting the online status of a computer
you can do it in python cgi really easily, don't think that what your after though

[Image: 5344.png]
[Image: sig.png]

A.k.a. The Glad Falconer














10-23-2009 12:26 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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