开发者

How to capture XML result from ASPX page with PHP

I would like to know how to do the following : I have a PHP page that sends some data to an 开发者_StackOverflow社区ASPX page and this one returns a XML file, my question is how can I capture this XML response from PHP so I can manipulate the XML file?


Your questions is pretty unclear on what exactly you want to do but here are some methods.

This can be done either using a GET from php or with Jquery /

 $.ajax({
      type: 'GET',
      url: "foo.aspx",
      data: {
        key: "value"
      },
      dataType: "xml",
      success: function(xml){
        var clientid = $(xml).find('client_id').eq(1).text();
        alert(clientid);
      }   
    });

With PHP I dont remember exact syntaxt but

$response = http_get("http://www.example.com/file.aspx");

EDIT :

As you mentioned now in comment above you want to post to a page written in PHP

    Dim web As System.Net.WebClient = New System.Net.WebClient
    Dim sr As System.IO.StreamReader
    sr = New System.IO.StreamReader(web.OpenRead("http://www.example.com"))
    Response.Write(sr.ReadToEnd)


I would first suggest looking at file_get_contents() first. If that doesn't work, look at the cURL functions.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜