Well what Grizzy says seems very valid. I hadn't thought about that but indeed it will always come from your server IP. Then when someone enters the information they are being sent to the affil and the affil suddenly sees a different IP.
Anyhow, here is some code:
<?php
$url = "hxxp:// affil . link . c0m/";
$ref = "hxxp:// my . website . c0m/";
$useragent = $_SERVER['HTTP_USER_AGENT'];
$s = curl_init();
curl_setopt($s,CURLOPT_URL,$url);
curl_setopt($s,CURLOPT_HTTPHEADER,array('Expect:'));
curl_setopt($s,CURLOPT_USERAGENT,$useragent);
if (!empty($ref)) curl_setopt($s,CURLOPT_REFERER, $ref);
curl_setopt($s,CURLOPT_AUTOREFERER, true);
curl_setopt($s,CURLOPT_FOLLOWLOCATION, true);
curl_setopt($s,CURLOPT_MAXREDIRS, 5);
curl_setopt($s,CURLOPT_RETURNTRANSFER, true);
$content = curl_exec($s);
curl_close($s);
echo $content;
?>
Please note that it might be needed to do some strreplace to modify the target of the form in the html.
(replace the hxxp urls by valid urls, seems i am not allowed to post URLs yet)