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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.