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?
Passing variables without post or get?
Moderator: General Moderators
-
dimxasnewfrozen
- Forum Commoner
- Posts: 84
- Joined: Fri Oct 30, 2009 1:21 pm
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Passing variables without post or get?
To pass variables to a different server?josh wrote:SESSION (http://www.google.com/search?q=php+sess ... en___US351)
You can look at http_post_data(), something here: http://us3.php.net/manual/en/book.http.php or possibly cURL.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Passing variables without post or get?
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)
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)