Jump to content

Getting a response back from a server cross domains simpleXML


gamak

Recommended Posts

So here is what i'm trying to

 

1. User submits the form ( I know how to do this)

2. Send the input via a HTTP POST/GET request to API url ( I know how to do this)

3. Parse the XML response via SimpleXML ( don't know how to do this)

4. Act on response and display results to user ( pretty sure I know how to do this)

 

So I've read up on simplexXMl, but i'm a little confused still.  Does anyone have an example they could show me?

Link to comment
Share on other sites

you cant get a result back from another domain using ajax unfortunatly, you have to get it with your server and then give it to your page,

 

1. call a method on your server using ajax post to it your stuff

2. get the results inside your server method by calling the other domain server

3. throgh your server method give the result back oputput to the ajax response in step 1

Link to comment
Share on other sites

The user inputs data on my server, and the data is sent off via POST to a Different server, and the response is a XML document. 

 

I need to read the XML document.

 

 

 

yeh when you get xml data from another server you have to put it in a file on your server then use simple xml and that tutorial to open it and then the simple xml tutorial will show you how to read it

Link to comment
Share on other sites

How do I put the XML document on my server. I don't have access to the other server?

 

you take the result of the request you sent the post or woteva ? send it using a httprequest php function and get teh result and write it to a file on your server, you can create files in your web site directory easily using fopen

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.