Short and sweet: Here is the code that accepts the post from paypal and posts a response to paypal using curl. (An asside -> if you need to know how to install curl w/ ssl support with win2k/apache/php, let me know. It's very simple.)
foreach ($HTTP_POST_VARS as $key=>$value) $query .= "$key=$value&";
$query .= "cmd=_notify-validate";
if ($ch = curl_init("https://www.paypal.com/cgi-bin/webscr")) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
curl_exec($ch);
curl_close($ch);
}
My problem is that I don't know how to fetch Paypal's response. If I view the page with the above code in my browser, I can see Paypal's response (which is INVALID in this case, because there is nothing posted to the page.)
How do I get the response into a script?
I know that there are many people trying to use php/paypal ipn and waiting for someone to show them how to do it. I believe that this script will work fine with paypal ipn once I find out how to fetch the response.
Thanks
Randall