开发者

How to send xml to a php page

I have a client application that gives its output as an xml file, i want the xml to be se开发者_运维技巧nt to a remote server and processed using php...


The no frills option would be to take the data in as a POST and process it with SimpleXML. You are leaving out a lot of details so that is just a guess as to what "processed" means for your application. This may help you get started:

<?php
  $xmldoc = simplexml_load_string($POST['xml_data']);
  print_r($xmldoc);
?>

One thing to note is that SimpleXML has to be compiled into your php install but in most cases I think it is default now.


You'll probably want to do an HTTP Post with the XML data properly encoded in the form. What language is the client application written in? How exactly is it outputting the XML?


You'll have to use the HTTP POST method, which requires a HTTP client library. Which one depends on the language your client is written in.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜