Re[2]: [PHP-WIN] Ping!

From: Date: Thu, 05 Oct 2000 23:40:40 +0000
Subject: Re[2]: [PHP-WIN] Ping!
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-2969@lists.php.net to get a copy of this message
> Good idea. > I found this here : http://mail.sefanet.ch/php/ping.php3 > Unfortunately it seems to be using the ping command of its host (an unix), > just returning its output. > I don't really know if it's possible to make a real ping in PHP. > Does PHP allow to forge ICMP packets ?? That would be best. Anyone out there knows if it can be done? > Trying to open a socket may not work if the computer you are trying to ping > has no listening ports. As a fact, at least in Windows networks, it doesn't. > If you want to make it portable, you can check for the OS and process the > ping response consequently. > But this is quite dirty :( Uh, uh, not only dirty, but unthinkable for a newbie... any other ideas? Thanks, Gonzalo. > Hope this helps, > John. > At 18:04 05/10/00 -0500, you wrote: >>Hi All: >> >>I'm trying to make a script that will check if several computers are >>online by pinging them (or any other suggested method, I know no >>others). I tried using fsockopen but, what port do I try? >> >>Most computers I want to locate are Win95/98, including the server >>running apache 1.3.12 and php 4.0.2, and all they have is UDP 139 >>protected with a fix that hides it. If I try to open a connection on >>an arbitrary port number, I always get an error since the target >>computer won't answer on that (or any other) port, so even if the >>computer is online, I get an error just as if it isn't online. >> >>I can use MS-DOS' "ping" command, and then check the output, but I'd >>like to keep my script as platform-independent as possible. >> >>Any ideas? Thanks, >> >>Gonzalo Vera.

« previous php.windows (#2969) next »