PHP Cross Site XML -


this question has answer here:

i have in file called abc.php, , return valid xml document, instead of showing -string- labels @ end , beggining

header('content-type: application/xml'); $xml = file_get_contents("http://www.xxx.asmx/test?id=1"); //external web service $xmlstr = simplexml_load_string($xml); echo $xmlstr; 

i want use valid xml data of abc.php, extract data, store in db, , check output of other server periodically, i've tried this:

ob_start(); include 'abc.php'; $result = ob_get_clean() 

as this:

$xml = file_get_contents("abc.php");  $xmlstr = simplexml_load_string($xml); 

without success, advice?

make sure output mime type well, or else server feed text/html , wrong. put function

header("content-type: application/xml"); 

in abc.php client recognize xml.


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -