I have created a XML string using PHP DOM.  However when I send it to a third
party using curl it shows up as part of an array and cannot be read.  How
should I be using curl to post a xml file.

My code is below
[code]
<?php
Require 'createxml.php';
$Result = simplexml_load_string($result);
$xmlResult= $Result->asXML();
$ch= curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Accept: text/xml"));
curl_setopt($ch, CURLOPT_URL, "http://testurl.com";);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlResult);
curl_setopt($ch, CURLOPT_POST,1);
curl_exec($ch);
[/code]

Any help would be appreciated.
-- 
View this message in context: 
http://www.nabble.com/Problems-posting-xml-file-with-curl-and-php-tp16129807p16129807.html
Sent from the PHP - General mailing list archive at Nabble.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to