-
PHP - send POST variables from one script to another without a form
how can i send variables from one script to another without having to place them in the url string?
i really don't want to have to save variables to the server and then send data in the url string about where they are kept
i want a script to be able to receive some data (either GET or POST) from a 3rd party website and then i can redirect to a new page depending on what is received. along with the redirecting i need to be able to pass certain variables
could i possible just store session variables? are these kept on the client or server computer?
-
Hi,
of course you can call a script on a foreign server from a script on your server.
If the foreign server works with GET variables, usually all you need to do is
fopen("http://www.google.com/?q=proxy", "r");
and then handle received data
If the foreign server wants POST variables, or even wants to create its own session, the process is somewhat more complex (but often the CURL package can be used from php). If this is not an option, you would use something like
$fp = fsockopen("www.site.com", 80);
fputs($fp, "POST /script.php HTTP/1.0
Host: www.site.com
Content-Length: 7
q=proxy");
and read the result. Note that in this case the result is preceded with a http header as well
Musicman
-
Sergei A. Kornev
Session variables is strored in temprory files on server.
-
thanks
i know that you can call it with get variables easily i just wasn't sure how to pass post variables
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|