Page 1 of 1

Passing variables without post or get?

Posted: Fri Jan 29, 2010 2:48 pm
by dimxasnewfrozen
Not sure how to do this but,

I have a form that does some validation from the POST variables

I need to send the POST variable to another page on a different server. Currently I am doing it this way:

$url = "http:servernumber2?id=$posted_variable
$myresult = file_get_contents($url);
echo $myresult;

Is there a way to pass the variable to the other file without sending it through the URL?

Re: Passing variables without post or get?

Posted: Fri Jan 29, 2010 3:15 pm
by josh

Re: Passing variables without post or get?

Posted: Fri Jan 29, 2010 3:20 pm
by AbraCadaver
To pass variables to a different server?

You can look at http_post_data(), something here: http://us3.php.net/manual/en/book.http.php or possibly cURL.

Re: Passing variables without post or get?

Posted: Sun Feb 07, 2010 9:07 am
by josh
How about a web service over https?

Example

Machine 1 sends XML of data ( as POST data over an https request) to Machine 2
Machine 2 saves parameters and assigns a session ID, passes session ID to machine 1
Machine 1 redirects user to Machine 2 using only the session ID in the URL.

http_post_data may not work for him because he wants the user to end on Machine 2, am I right? Well it would work but you need the last 2 steps.

By the way SESSION would work too and would be my preference. You would just have to customize PHP to work under that set up (by overriding save handlers and such)