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?

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

Didn't think I needed to use AJAX?

 

if your not using ajax then you can post to another server,

 

you have to create a file of type xml on your server and put teh result in there

 

use fopen fwrite etc

 

http://www.onlamp.com/pub/a/php/2004/01/15/simplexml.html

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.