bashir Posted February 25, 2006 Posted February 25, 2006 Hello, In the checkout_process.php i have done coding changes to send a sms text-message to the shop-owners mobile when a order is registered. I am using fsockopen to connect to the sms-provider. i dont want oscommerce showing the warnings/errors to my customer when the sms-providers server is down. HOW CAN I CATCH THE FSOCKOPEN ERRORS/WARNINGS ? This is shown when the connection fails: Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/blabla/checkout_process.php on line 342 Warning: fsockopen(): unable to connect to sms.psnet.com:1111 in /home/blabla/checkout_process.php on line 342 Warning: fclose(): supplied argument is not a valid stream resource in /home/blabla/checkout_process.php on line 418 Warning: Cannot modify header information - headers already sent by (output started at /home/blabla/checkout_process.php:342) in /home/blabla/includes/functions/general.php on line 29 thanx
Guest Posted February 25, 2006 Posted February 25, 2006 use @fsockopen, @fopen, @fclose etc. To determine the error pass 2 parameters for error number and error string. Parameters 3, 4 with fsockopen.
bashir Posted February 25, 2006 Author Posted February 25, 2006 enigma, thanx for your reply. i am not so good with php coding, could u plz give a coding example how i can use f.ex. @fsockopen? as i said i dont want the errors to be shown to the customer. use @fsockopen, @fopen, @fclose etc. To determine the error pass 2 parameters for error number and error string. Parameters 3, 4 with fsockopen.
bashir Posted February 25, 2006 Author Posted February 25, 2006 ok, i am putting a parameter in place 3 and 4, but what i want is not to show the errors/warnings that fsockopen could give to my customer...hope this describers what i am looking for // Opens a connection to the gateway $pscomsmsgateway = fsockopen ($host, $port, $errno, $errstr);
Guest Posted February 25, 2006 Posted February 25, 2006 $pscomsmsgateway = @fsockopen ($host, $port, $errno, $errstr);
bashir Posted February 25, 2006 Author Posted February 25, 2006 thanx mate, that worked. $pscomsmsgateway = @fsockopen ($host, $port, $errno, $errstr);
Recommended Posts
Archived
This topic is now archived and is closed to further replies.