With cURL
http://www.php.net/manual/en/ref.curl.php
$curl_handle = curl_init();
if (!$curl_handle) {
die('fail to initialize');
}
curl_setopt($curl_handle, CURLOPT_TIMEOUT, 30);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 30);
//target URL setup
curl_setopt($curl_handle, CURLOPT_URL, 'https://destination.cm/fg');
//mime type setup, change if necessary
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array("Content-Type: application/xml"));
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_FAILONERROR, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1);
//here you assign the body of your request
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $xmlVariable);
$response = curl_exec($curl_handle);
if (curl_errno($curl_handle)) {
die(curl_error($curl_handle));
}
printf("Received :\n%s", $response);