kraadde Posted December 14, 2007 Share Posted December 14, 2007 In my prog I have a socket connection like below. $fp = fsockopen("$host", $port, $errno, $errstr, 30); if (!$fp) {....... everything works perfectly. However, today I opened the site while the host was down. The website returned an error message (...fsocket connection could not open...error on line...). This is very annoying since the error message shows information about the source page and code.. BTW, error_reporting(E_ALL) is NOT included in my code. Any hint how I can avoid that kind of error message? kraadde Quote Link to comment Share on other sites More sharing options...
lemmin Posted December 14, 2007 Share Posted December 14, 2007 You can use the '@' character to hide errors "or" to execute something if it fails. $fp = @fsockopen("$host", $port, $errno, $errstr, 30) of die("Your own error message"); Quote Link to comment Share on other sites More sharing options...
kraadde Posted December 14, 2007 Author Share Posted December 14, 2007 Thanks lemmin. I learned again something from you guys! kraadde Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.