// The lead/buyer email address. You get this value from your script $email = "jon.doe@yahoo.com"; // The Post URL (Get this value from the settings menu of the affiliate plugin) $postURL = "http://www.example.com/wp-content/plugins/wp-affiliate-platform/api/remote-lead-capture.php"; // The Secret key (Get this value from the settings menu of the affiliate plugin) $secretKey = "4bc67180656782.45045137"; // Retrieve the value from the browser's cookie to find out who the referrer was $affiliate_id = $_COOKIE['ap_id']; // Prepare the data $data = array (); $data['secret'] = $secretKey; $data['ap_id'] = $affiliate_id; $data['buyer_email'] = $email; // send data to post URL to award the commission $ch = curl_init ($postURL); curl_setopt ($ch, CURLOPT_POST, true); curl_setopt ($ch, CURLOPT_POSTFIELDS, $data); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); $returnValue = curl_exec ($ch); curl_close($ch);