In anyway, there is a simple way to go it. Create a small script using the curl library. Set this to be your PayPal return page. The script will send the recieved data to both notify URLs (the one of the PayPal mod and the one of the Affiliate program.
A possible script could be like this:
<?php
// Recieve the paypal data and create the necessary extension to the URLs
$add = "?";
while (list ($key, $val) = each ($_GET))
{
$add .= "$key=$val&";
}
$add = rtrim($add, '&');
//Change the URLS to be the real ones
$notify_URL[1] = "http://www.yourdomain.com/
path_to/paypalmod_returnpage.php".$add;
$notify_URL[2] = "http://www.yourdomain.com/
path_to/affiliate_returnpage.php".$add;
// Prepare to POST
//Initialize the CURL session
$ch = curl_init();
$post_data['submit'] = "submit";
for ($i = 1; $i <= 2; $i++){
// Set the script to post to the notify URL
curl_setopt($ch, CURLOPT_URL, $notify_URL[$i] );
// Indicate the request method (POST)
curl_setopt($ch, CURLOPT_POST, true );
// We just send the "submit" value through POST
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
// Specify that the curl_exec function should return // the "success" or "failed" output from the two notify URL scripts. // instead of sending it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Connect, send data and store in // $postResult the output of the notify URL scripts
$postResult = curl_exec($ch);
// If there are errors, display them
if (curl_errno($ch)) {
print curl_error($ch);
}
// If you wish (not this case) display the destination script output //echo "$postResult <br>";
}
// Close the CURL session
curl_close($ch);
?>
You can see how it works in
http://www.dbtechnosystems.com/post/...23&b=456&c=789
Please note that the a=123&b=456&c=789 part is only used to show you how the script recieves the data from PayPal, and then it passes it through POST to the two Notify URLs.
Change the numbers (ONLY the numbers and characters, do NOT touch the ? and & ) to whatever you like to see your own details, as if it were PayPal data.
In this case these two notify URLs that i created don't do anything else than recieve the POST data and print them in the screen, but when you use the actual notify URLs of your paypal mod and your affiliate script, they will both act as if they had recieved the data directly from PayPal.