Forum Moderators: coopster
$xmlData = "<xml><command name="get"/><Id>85</Id></xml>";
$curlObject = curl_init();
//Sets an option on the given cURL session handle
curl_setopt($curlObject, CURLOPT_URL, "http://myurl.com");
//do not get the Header
curl_setopt ($curlObject, CURLOPT_HEADER, false);
// get the response as a string from curl_exec(), rather than echoing it
curl_setopt ($curlObject, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($curlObject, CURLOPT_POST, true);
curl_setopt ($curlObject, CURLOPT_POSTFIELDS, "$xmlData");
$response = curl_exec($curlObject);
print $response;
curl_close ($curlObject);
$ch = curl_init();
/**
* Set the URL of the page or file to download.
*/
curl_setopt($ch, CURLOPT_URL,
'www.myurl.com');
/**
* Ask cURL to return the contents in a variable
* instead of simply echoing them to the browser.
*/
curl_setopt ($ch, CURLOPT_POSTFIELDS, "$xmlData");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
/**
* Execute the cURL session
*/
$contents = curl_exec ($ch);
/**
* Close cURL session
*/
curl_close ($ch);
print $contents;