Hi there,
I have a problem with cURL and magic_quotes.
for different reasons i cannot turn magic_quotes off.
But i do need to disable this feature when I create a CURL POST request.
In this CURL POST request I pass a variable that contains XML and xml opening tag, something like this:
$xml_request = '
<?xml version="1.0"?>
<SaleRequest>
<CustomerData>
<Email>alex@virtuman.com</Email>
<CustomerData>
<SaleRequest>';
after I create a curl post request:
$url="https://my.secureserver.com/parsexmlscript.cgi";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "xml=".$xml_request);
curl_setopt ($ch, CURLOPT_HEADER, 0);
$result = curl_exec ($ch);
curl_close ($ch);
in the result: request received on the secure server - first opening tag looks like this:
<?xml version=\"1.0\"?>
(with version attribute is with magic quotes)
after this xml parser dies telling me that XML document is not well formed.
is there any way to disable magic quotes for only one script that creates this post request ?
or may be there is any other way of getting around it ?
any help is greatly appreciated!!!