[PHP] fsockopen() errors.

2004-03-08 Thread Phil Ewington - 43 Plc
Hi All,

Can anyone tell me the best way to avoid errors using fsockopen(). I have
tried wrapping the function call in a conditional statement, and have also
tried calling the function and then testing the return.

Example 1:
$sckHandle = fsockopen($server, 25, $errNo, $errString);
if ($sckHandle)
{
code here...
}


Example 2:
if ($sckHandle = fsockopen($server, 25, $errNo, $errString))
{
code here...
}

both give this error on failing to connect to a given server:

fsockopen(): unable to connect to mx3.hotmail.com:25

I was under the impression that example 2 would not trigger an error if
fsockopen() failed. Any help will be greatly appreciated.

Phil.

---
Phil Ewington - Technical Director

43 Plc - Ashdale House
35 Broad Street, Wokingham
Berkshire RG40 1AU

T: +44 (0)1189 789 500
F: +44 (0)1189 784 994
E: mailto:[EMAIL PROTECTED]
W: www.soyouthink.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] fsockopen() errors.

2004-03-08 Thread Miguel J. Jiménez
Is it an error or a warning? If it is a warning you can try use @  
before fsockopen() to avoid echoing warning messages [EMAIL PROTECTED](...)].

--

Miguel J. Jiménez
ISOTROL, S.A. (Área de Internet)
Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA)
[EMAIL PROTECTED]
TLFNO. 955036800 ext. 111
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] fsockopen() errors.

2004-03-08 Thread Phil Ewington - 43 Plc
Hi Miguel,

I am giving it a test at the moment, thanks.

-- Phil.


 -Original Message-
 From: Miguel J. Jiménez [mailto:[EMAIL PROTECTED]
 Sent: 08 March 2004 12:29
 To: Phil Ewington - 43 Plc
 Cc: PHP
 Subject: Re: [PHP] fsockopen() errors.


 Is it an error or a warning? If it is a warning you can try use @
 before fsockopen() to avoid echoing warning messages [EMAIL PROTECTED](...)].

 --

 Miguel J. Jiménez
 ISOTROL, S.A. (Área de Internet)
 Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA)
 [EMAIL PROTECTED]
 TLFNO. 955036800 ext. 111

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] fsockopen() errors.

2004-03-08 Thread Phil Ewington - 43 Plc
Hmm, added @ to fsockopen() function, still happens, can anyone shed any
light on this?

TIA

Phil.



 -Original Message-
 From: Phil Ewington - 43 Plc [mailto:[EMAIL PROTECTED]
 Sent: 08 March 2004 12:57
 To: Miguel J. Jiménez
 Cc: PHP
 Subject: RE: [PHP] fsockopen() errors.


 Hi Miguel,

 I am giving it a test at the moment, thanks.

 -- Phil.


  -Original Message-
  From: Miguel J. Jiménez [mailto:[EMAIL PROTECTED]
  Sent: 08 March 2004 12:29
  To: Phil Ewington - 43 Plc
  Cc: PHP
  Subject: Re: [PHP] fsockopen() errors.
 
 
  Is it an error or a warning? If it is a warning you can try use @
  before fsockopen() to avoid echoing warning messages [EMAIL PROTECTED](...)].
 
  --
 
  Miguel J. Jiménez
  ISOTROL, S.A. (Área de Internet)
  Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA)
  [EMAIL PROTECTED]
  TLFNO. 955036800 ext. 111
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php