Hi,
Can anyone help me with this?
What I have is -
perl_script1 submits some data to perl_script2 on another server using a regular html form. The data is processed and returned to perl_script1 using a LWP POST. Perl_script 1 then processes the data and prints an html page.
What I have noticed is that the url shown on the browser stays on perl_script2's url after the LWP.
How do I get the url to return to perl_scipt1's url?
Preferably I don't want perl_script2's url to show at all.
Is there something I can add to the following code to redirect the url on POSTing the data??
# Create a user agent object
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);
# Create a request
my $req = new HTTP::Request POST => ' $req->content_type('application/x- $req->content($redirect);
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
# Check the outcome of the response
if ($res->is_success) {
print $res->content;
} else {
print "Bad luck this time\n";
}
Thank you.
Simon.
Can anyone help me with this?
What I have is -
perl_script1 submits some data to perl_script2 on another server using a regular html form. The data is processed and returned to perl_script1 using a LWP POST. Perl_script 1 then processes the data and prints an html page.
What I have noticed is that the url shown on the browser stays on perl_script2's url after the LWP.
How do I get the url to return to perl_scipt1's url?
Preferably I don't want perl_script2's url to show at all.
Is there something I can add to the following code to redirect the url on POSTing the data??
# Create a user agent object
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);
# Create a request
my $req = new HTTP::Request POST => ' $req->content_type('application/x- $req->content($redirect);
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
# Check the outcome of the response
if ($res->is_success) {
print $res->content;
} else {
print "Bad luck this time\n";
}
Thank you.
Simon.