This is XML request using CURL <?php $url = "http://localhost/members/mailbiz_external.php"; $request = <<<XML <?xml version="1.0" encoding="UTF-8"?> <address> <userid>333</userid> <!-- nur Zahlen --> <salutation>Herr</salutation> <firstname>Max</firstname> <lastname>Mustermann</lastname> <company>beispiel</company> <street>Somewhere. 296</street> <postalcode>12345</postalcode> <city>Anywhere</city> <country>Deutschland</country> </address> XML; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FRESH_CONNECT, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); $xml = curl_exec($ch); echo $xml; curl_close($ch); ?> PHP: And the mailbiz_external.php page look like, <? print_r($_POST) ?> PHP: This gives result of array. But My problem I cant assign this array element (the xml) into a variable. I am not sure how can I access the variable so that I get the xml to proceed. I have tried $xml=$_POST[0]; but not work. Pls help
$request = urlencode($request); curl_setopt($ch, CURLOPT_POSTFIELDS, "xml={$request}"); PHP: ... you have to specify a name for the XML data.