I have two site (eg wwww.mydomain.com and wwww.mydomain2.com) which i need to update using paypal IPN (Instant Payment Notification). Currently I can only update one site. Is there anyway to update both of the site. Paypal only allow one ipn update eg wwww.mydomain.com/ipn.html. Pls let me know if i can update more than one domain.
Assuming that your IPN validation script is called validate.php at both domains: - Domain one: At the end of the validate.php file, add the following code: $variables2pass = array_merge($_POST, $_GET); bi_validate($variables2pass); function bi_validate($_dvalues) { // Settings Array $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL,"http://www.domain2.com/validate.php"); curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt ($ch, CURLOPT_TIMEOUT, 20); curl_setopt ($ch, CURLOPT_FOLLOWLOCATION,1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, $_dvalues); curl_setopt ($ch, CURLOPT_POST, 1); $result = curl_exec ($ch); curl_close($ch); return $result; } PHP: This requires cURL to be installed at your server. Please also notice that this is pseude code, some typos might exist
In a couple of words, it's a PHP extension thar works just like the PEAR:Request module, more at http://curl.haxx.se/