Page 1 of 1

Using the response to a http post from an external page

Posted: Thu Jun 19, 2008 5:15 am
by chrisjim
Hi,

I'm a php rookie and I hope that I dont annoy anyone with such a simpel question.

I have the following problem:

I'm trying to program the connection from my cms to an external service. The API ist based on: HTTP -> xml response.

Now, if I send the http post data to the php-api-page (external) the browser will open the php-api-page with the xml response, which is of course perfectly normal. The problem I have is, that I don't have a clue how I can access this response with my next php page (or the first php page which does the http post)
The problem is not, that I dont know how to read xml or that I don't know how to use http post, but that I dont know how I can program it, so that the following is going to happen:

myphppage1.php -> phppost to externalsite.php -> myphppage2.php pops up and uses the response from externalsite.php

Re: Using the response to a http post from an external page

Posted: Thu Jun 19, 2008 6:25 am
by jaoudestudios
Page 1 > you will need a form which collects the user's choices (if thats what you want to do)
Page 2 > build up the http request query from the form results on the previous page, then send the http request and save the response using $string = file("http request");

Then you will have the results in a string and you can do what you want with it.

Hope that helps.