Re: Ping
| From: | Emanuel Harangus | Date: | Fri, 06 Oct 2000 13:13:49 +0000 |
| Subject: | Re: Ping | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-2998@lists.php.net to get a copy of this message | ||
At 15:10 06/10/00 +0200, Rygars wrote:
I have tested it on my network (linux[samba installed]+win95+win98+winnt+win2k) and it works. All
the OS answered correctly to the script. I am not sure if samba was the cause of linux answer but it
worked alright. I will post later the entire script as I am working now on it to give it a nice
face.
BTW... I have run the script both from linux and win2k (not tested on winnt and win9x) and it
works fine with one note... from linux the script is faster (10-20 times faster).
>At 11:01 06/10/00 +0200, you wrote:
>><?php
>>$host="192.168.220.108";
>>$port=139;
>>$s=fsockopen($host,$port);
>>if(!$s){
>> echo "$host is NOT online.<BR>";
>>}else{
>> echo "$host is online.<BR>";
>>}
>>@fclose($s);
>>?>
>>
>>This should work. It works for me [Win2k, Apache 1.3.12, PHP 4.0.2-dev].
>
>It'll work only for windows based target machines (or other ones who listen
>on port 139 (netbios))
>It's not a real ping :(
>But it should still be suitable for windows networks ...
>
>Cheers,
>John.
>
>
>