I originally posted this here: Mad4 has the right idea I believe: I know am to the point where I have the www.mysite.com/QuoteHome.php page looking like this: <? $zip = $_REQUEST["zip"]; $URL="www.affiliatelandingpageoffer.com"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://$URL"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "Refby=affiliateIDHere&Type=Health&zip=Zip%20Code");curl_exec ($ch); curl_close ($ch); ?> PHP: However, this behaves weirdly in that it takes info from the affiliate landing page and brings it over onto my site onto the QuoteHome.php page and shows weird error messages. Ideas?
How is that weird? That's exactly what yuor code does. It takes the landing page and brings it to your page. The error might come because you harcocded a non-valid zip code in the URL.
Are they errors from php, lets have them and the lines of code above and below the lines mentioned in the error <5 lines>
Sorry for my ignorance in PHP - I think I probably just have everything set up backwards then. My goal is to have: 1 Affiliate quote box offer on index page linking to (rel=nofollow) 2 QuoteHome.php page on my site (no index, no follow in headers and robots.txt) acting as a conduit page to automatically post data from index page and then on to affiliate landing page
<? $zip = $_REQUEST["zip"]; $URL="www.insureme.com/Landing.aspx"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://$URL"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "Refby=613786&Type=Health&zip=Zip%20Code");curl_exec ($ch); curl_close ($ch); ?> PHP:
Unless I'm misunderstanding your aims I don't think curl is the solution. You can't (as far as I am aware) set up a session in php with curl and then hand it over to a visitors browser. If you copy their form code over onto your page it should still submit correctly, then all you need to do is use meta tags/robots.txt to prevent the search engines from indexing the page.
I think I am getting somewhere now. On the QuoteHome.php page I now have the affiliate code as well as this php: <? $zip = $_REQUEST["zip"]; ?> PHP: as well as this for the value: value= <? print "$zip"?> PHP: This now gives me my conduit page. However, a submit button still needs to be pressed on the QuoteHome.php page (for the second time) to then post the data onto the affiliate site. It seems that all I need is a little script to submit the button automatically as soon as the page loads. I have tried a few things but still havent found the right thing....