0

I'm sending a post to an url, and after successfully sending the post, it will turn to another page, now how to find the another page url?
<code=perl>
#!/usr/bin/perl
use LWP 5.64;
my %form;
$form{"name"} = $name;
$form{"email"} = $email;
$form{"grade"} = $grade;
my $res;
my $url = "http://www.mydomain.com/register.php";
SIG{ALRM} = sub {print "timeout";};
eval{
alarm(30);
$res = $ua->post($url, \%form);
alarm(0);
};

$page_content = $res->content if $res->is_success;

</code>

After successfully sending the post request, it will turn to something like http://www.mydomain.com/payment.php.

I'm trying to find the page content of payment.php, however, the above script will still get the page content of register.php.

My question now is how to detect that the request turned to payment.php and get its content then?

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by mitchems
0

How are you doing the redirect in the PHP? The problem (for me) seems to be in the method of "turning to" another page. If you do a redirect (via a 300 code), perhaps it will return the content of your new page. I think it all depends on the method that you're "turning to" the new page.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.