Re: fsockopen()
| From: | Cameron Metzke | Date: | Tue, 30 Sep 2003 10:56:05 +0000 |
| Subject: | Re: fsockopen() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164370@lists.php.net to get a copy of this message | ||
Ima having problems myself with this, i dont seem to get errors when
entering an invalid .com or .net name i put it down to verisign hijacking
invalid somains?? could this be your problem?
"Phil Ewington - 43 Plc" <phil.ewington@43plc.com> wrote in message
news:CMEGJANHOICDLIHPAJBCMELDEFAA.phil.ewington@43plc.com...
> Hi All,
>
> I am having problems with fsockopen() and wondered if anyone else has
> encountered this behaviour. My problem is that when connecting to an
invalid
> domain I cannot trap the errors.
>
> I have tried setting a variable then testing the value, which prints a
> warning to the screen...
>
> $sck_handle = fsockopen($hostname, $port, $errno, $errstr, $timeout);
> if (!$sck_handle)
> {
> // socket could not be opened.
> $http_statuscode = "Error:" . $errno . "-" . $errstr;
> }
> else
> {
> ...
> }
>
> How can I get $errno & $errstr, are these for read/write errors rather
than
> socket initialisation? I need to know why the socket could not be opened
so
> I can give an appropriate error message.
>
> TIA
>
>
> Phil Ewington - Technical Director
> ----------------------------------
> 43 Plc
> 35 Broad Street, Wokingham
> Berkshire RG40 1AU
> T: +44 (0)118 978 9500
> F: +44 (0)118 978 4994
> E: mailto:phil.ewington@43plc.com
> W: http://www.43plc.com