Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to get the redirected URL?

Status
Not open for further replies.

fsqueeen

Programmer
Jul 8, 2002
43
MY
hi,
i had a situation here. Is it possible for me to get a return of url by a perl command?

E.g.
Pg A(currently)->Pg B->Pg C->....->Pg D
'->' means 'redirect'

Is there a perl function can retrieve the URL of Pg D from Pg A?

Like i m currently in Pg A, then inside the a.pl, i write
Code :
print a_perl_func(Pg_B);

Browser Output :

Meanwhile i m still standing in a.pl

Can perl do that? What i hope to get is the URL of the final landing pg, no matter how much pg redirected. But it sounds crazy for me. :~o

Thanks
 
Unless you're storing a sort of breadcrumbs variable which holds all the pages you've visited, I'd suggest that you'll only be able to go back to the referring url of the last page.

$pages_visited.="B|";

HTH
 
First of all, Thanks for reply my post.
But is important for me to get the final landing page's url, which is url of Pg_D. But in real life, i don't have control for page other then pg_A, which is reside in my domain. All other page is reside in client's domain and not mine.

So, would it be impossible for me to retrieve the final url, which will be return when the series of redirection to stop?

Thanks
 
If you don't have control over the code at your clients domain, there's no way to see where the final redirect will take the user, they could tell you one thing and do another.

Once it leaves your domain, that's all there is ... unless it's going to CGI pages you wrote and have access to on your client domains

HTH

Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top