I am getting PHP to fetch some XML data from anotehr server
the client makes a request via XMLhttp
<?php
header("Content-type: text/xml; charset=UTF-8");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("HTTP/1.1 200 OK");
$myaddress = 0.0.0.0;//changed fro securtity;)
$xmlurl = "http://".$myaddress."/betaXML?sql=execute ".$_GET["sp"].$_GET["vars"]."&Root=".$_GET["root"];
$xmlurl = stripslashes(rawurldecode($xmlurl));
$get = simplexml_load_file($xmlurl);
echo $get ->asXML();
?>
Everything is fine except that the returned data/document is included twice
<?xml blah...><root><data/></root><?xml blah...><root><data/></root>
and thus I get "XML Parsing Error: junk after document element"
I added a line to see what was coming from the end server
file_put_contents("c:\simple.xml", $get->asXML());
and it returns correct data in single, well-formed XML document
does anybody have any clues where I might look
btw, I think it is something to with the size of the file as some smaller queries work, but the ones that are failing are only about 40kb
Im using ISAPI PHP 5.2.5