fsockopen() errors.

From: Date: Mon, 08 Mar 2004 12:01:13 +0000
Subject: fsockopen() errors.
Groups: php.general 
Request: Send a blank email to php-general+get-179733@lists.php.net to get a copy of this message
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:phil.ewington@43plc.com W: www.soyouthink.com

« previous php.general (#179733) next »