Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am trying to develop a script that processes data arriving via GET statement into my PHP script and posts reponse to another URL as a GET statement containing a list of variables. How can I generate this GET statement from PHP and send it to predefined URL?
Thanking you in advance ... Oleg

Normally PHP questions in this forum are answered quickly. The reason your question staid unanswered a little longer is not certain to me, but may have something to do with the fact that your question wasnt real clear...
You can use this function to open connections to a (http)server.Is this what you were looking for?

:D
I see it as if he's just want to retrieve some variables from URL (GET), while also sending some other variables (also using GET) :D
ok, let's make sure :D
to Fem:have you looked at Khalid's link? is that what you mean?
if not, please answer this:
1. do you know how to receive the "data arriving via GET statement" in your PHP script?
2. do you just want to know how to send the variables to "predefined URL" by using GET?
for #1, I did try to look for some basic form tutorial, but I can't find anything specifically for your case... so here's a little script, you might want to search the functions on google to find what they're for...
<?php
// assuming you call this script as:
// http://scrip_location/?name=Mike&born=2000// check the variables
if ((isset ($_GET['Mike'])) and (isset ($_GET['born']))){// simple process
$theName = $_GET['name'];
$theAge = 2004 - $_GET['born'];// print the result on screen
echo 'Hello '.$theName.', you\'re '.$theAge.' years old...';// send to to predefined URL (php script?)
header ("Location: http://predefined_url_here/?thename=".$theName."&stamp=".time());exit();
}?>
is that what you mean?
^o^
are you in Asia? do you watch Animax Asia? Please Vote

this:
if ((isset ($_GET['Mike'])) and (isset ($_GET['born'])))
should be:
if ((isset ($_GET['name'])) and (isset ($_GET['born'])));
^o^
are you in Asia? do you watch Animax Asia? Please Vote

Khalid, Laler,
Thanks a lot for your postings and apologies for not being clear in my question.
The objective of the script is:
1. Receive variables from remote server via GET method
2. Process variables based on internal application logic and generate response -- another set of variables
3. Send response variables to remote server
4. Capture unique integer sent by the remote server as an acknowledgement of receiving my submissionSolution I've used:
1. Submitted variables were processed by simply adding $ to the names of the variables in the get string
2. Processing was simple use of logic, loops and MYSQL queries.
3. and 4. I have combined into one step by using function $responseid=file_get_contents(http://serverurl?$my_variables) ... see posting http://www.computing.net/webdevel/wwwboard/forum/977.html for more info.Works extremely well.
Thanks again for your help,
Oleg

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |