So I had a page which I absolutely could not change or rename. The challenge was, this page would normally receive POST data, and I had to pass or relay this POST data to another page, which resided on another domain. I tried .htaccess, but that didn’t work, so I figured that I had to do some programming. It was simple enough with the curl library to do so, and here it is – The method to pass POST data from page to page:
$todo = ""; while (list($name, $value) = each($HTTP_POST_VARS)) { $todo.=$name."=".$value."&"; } $ch = curl_init('http://path.to/your/filename.php'); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, $todo); curl_exec ($ch); curl_close ($ch); ?>
Done!