PHP Developer

My notes and thoughts about Linux, WordPress, PHP, WPML, Toolset and many more.

PayPal IPN Handler Script using Curl in PHP 5: Complete Working Example

I recently encounter a bug with my old IPN handler script in PayPal. It is working in PHP4 many years ago and right now I need to fix it. Before it is using fsockopen but some of my clients complain its not being compatible with their servers. So I revised the IPNhandler script below using Curl, this is only an example. The PayPal fields depends on your application.

Take note that the script was written for a sandbox environment so please test that first before deploying it to your production server.

Below is the source code:

This Curl version is perfectly working for me.

Featured image credits: commons.wikimedia.org/wiki/File:PayPal_Logo2014.png

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">