tags:

views:

81

answers:

2

i'm supposed to come up with a dialog with another developer's script (from another company)

so, here's the basic rundown: 1) i send a request to http://some-url.com?param=foo 2) he sends me info back in the POST fields

the question i have is, how do i directly access the POST array that is sent back to me?

lets say his POST field is ?param1=foo&param2=bar

and lets say my code is something like

$url = 'http://some-url.com?param=foo';
curl_setopt($curl_session, CURLOPT_URL, $url);
curl_setopt($curl_session, CURLOPT_HTTPGET, TRUE);
curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, TRUE);

$curl_result = curl_exec($curl_session);

my intuition sometimes off when it comes to these things. i've seen something referring to $HTTP_RAW_POST_DATA or to php://input, but neither say how to actually use them.

my intuition says that after i've done the curl_exec($curl_session), that $HTTP_RAW_POST_DATA['param1'] and $HTTP_RAW_POST_DATA['param2'] will be what i'll be using.

am i right? or could someone steer my ship in the right direction?

A: 

The Response is in $curl_result ;) But what are you trying to do? Are you trying to actually POST the fields or somthing else?

You should read up on the curl docs.

Byron Whitlock
i just need the values given in the POST parameters to validate a transaction. i just need to know "where" in curl_result they end up being, ya know?
zaphod
What exactly are you trying to accomplish? It seems like terminology is getting confused here.
Byron Whitlock
yeah, thats what i'm thinking also. like i said, this isn't exactly my area of knowledge and i've been doing my best to keep up. i will try to clarify with the dude at the other end.thanks you all for the help.
zaphod
+1  A: 

There seem to be some confusion. "POST fields" are an optional part of an HTTP request not an HTTP response.

It appears that you'll be sending a request. Therefore he'll be returning a response. This response may contain an easily parseable set of key-value pairs, but they wouldn't be "POST anything".

mjv