Possible Duplicate:
Passing $_POST values with cURL
I am trying to use curl to pass on $_POST values sent from a form to a itermediary verification page, on to another server for processing ...and then back ot our server to display success page.
Here is what I have:
unset($_POST['recaptcha_challenge_field']);
unset($_POST['recaptcha_response_field']);
$params = $_POST;
foreach ( $params as $key => $value) {
$post_items[] = $key . '=' . $value;
}
$post_string = implode ('&', $post_items);
$curl_connection =
curl_init('http://server.somedomain.net/about/spit.php');
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT,
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
$result = curl_exec($curl_connection);
print_r(curl_getinfo($curl_connection));
echo curl_errno($curl_connection) . '-' .
curl_error($curl_connection);
//close the connection
curl_close($curl_connection);
The data seems to be there and in the correct format but it does not send out to the server, as far as I can tell. Any idea what is wrong with this? I am a bit baffled.
Dave