PHP Cross Site XML -
this question has answer here:
- php httprequest 3 answers
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
Post a Comment