note 41765 added to function.fsockopen
| From: | webmaster at neoziggy dot com | Date: | Wed, 21 Apr 2004 20:18:22 +0000 |
| Subject: | note 41765 added to function.fsockopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-68478@lists.php.net to get a copy of this message | ||
If by any chance you are using this function to check if a server/host is online/reachable and you
are getting error messages when it is unreachable/offline, remember to use the
'error_reporting()' function... an example of the script I use to check if a server is
online or not (for file download mirors, ect.)
<?php
error_reporting(0);
$servertest = fsockopen("www.WEBSITE.com",80,$errno,$errstr,30);
if (! $servertest) {
echo("server offline");
} else {
echo("server online");
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.fsockopen.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41765
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41765&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41765&report=yes
Search -- http://master.php.net/manage/user-notes.php