angelleye Posted April 26, 2010 Share Posted April 26, 2010 This should be real simple I just don't know how to do it. I'm using PayPal IPN to process order data. IPN is setup to automatically re-try the IPN if doesn't receive a 200 OK response back from the IPN script. In my solution, though, I'm actually storing any MySQL errors and notifying the site owner so the script actually does successfully complete and send a 200 OK back to PayPal, therefore, the IPN is not re-tried. I'd like to send a 500 (or anything other than 200) back to PayPal when this happens, but of course, the script still needs to run successfully. Is there a way I can use header() or anything to force a specific response code back? This way if it's simply a matter of MySQL timing out (which tends to happen on shared servers sometimes) PayPal's system will re-try and I won't have to enter it myself. Any information on this would be greatly appreciated. Thanks! Link to comment https://forums.phpfreaks.com/topic/199804-force-a-500-server-error-response-to-a-requesting-application/ Share on other sites More sharing options...
andrewgauger Posted April 26, 2010 Share Posted April 26, 2010 Try: <?php header('x', TRUE, 500);?> http://www.php.net/manual/en/function.header.php#93870 Link to comment https://forums.phpfreaks.com/topic/199804-force-a-500-server-error-response-to-a-requesting-application/#findComment-1048752 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.