gamak Posted May 14, 2009 Share Posted May 14, 2009 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? Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted May 14, 2009 Share Posted May 14, 2009 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 Quote Link to comment Share on other sites More sharing options...
gamak Posted May 14, 2009 Author Share Posted May 14, 2009 Didn't think I needed to use AJAX? Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted May 14, 2009 Share Posted May 14, 2009 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 Quote Link to comment Share on other sites More sharing options...
gamak Posted May 14, 2009 Author Share Posted May 14, 2009 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. Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted May 14, 2009 Share Posted May 14, 2009 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 Quote Link to comment Share on other sites More sharing options...
gamak Posted May 16, 2009 Author Share Posted May 16, 2009 How do I put the XML document on my server. I don't have access to the other server? Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted May 17, 2009 Share Posted May 17, 2009 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.