Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Catch fsockopen errors in oscommerce


Recommended Posts



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.





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




Link to comment
Share on other sites

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.
Link to comment
Share on other sites



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);

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...