note 28487 deleted from function.fsockopen by nlopess
| From: | nlopess@php.net | Date: | Sat, 27 Dec 2003 15:13:49 +0000 |
| Subject: | note 28487 deleted from function.fsockopen by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-62563@lists.php.net to get a copy of this message | ||
Note Submitter: kj@mendosus.org
----
I use fsockopen at my webpage to verify some services, like ftp and streaming server and such. If
fsockopen can connect to the given IP+port it is a verification that the service runs. Example:
if($fp = fsockopen ("xxx.xxx.xxx.xxx", 21, $errno, $errstr, 10)){
echo "FTP server in online";
}else{
echo "FTP server is offline";
}
$fp = null; //Don't use fclose() here. If the connection was refused it will throw an error
Just as an idea of how to use it.
regards
Kristian