Hi,
I want to capture the final url that a website redirects to.
Here is an example of what I mean:
www.example.com/sites.php?pd=45
When you click on that link, the site will redirect you to
www.Joe-Blogs.com/green/prod1.html?a=52 7
As you can see they are two different sites.
What I would like to do is pick the
www.Joe-Blogs.com/green/prod1.html part of the final url
and put it in a variable called $final_url.
So if I have :
What would be the best way to get to that $final_url.
Should I be using cUrl or would
file() or get_file_conten ts() be able to get the url ?
Any ideas on how I can get to my $final_url ?
I want to capture the final url that a website redirects to.
Here is an example of what I mean:
www.example.com/sites.php?pd=45
When you click on that link, the site will redirect you to
www.Joe-Blogs.com/green/prod1.html?a=52 7
As you can see they are two different sites.
What I would like to do is pick the
www.Joe-Blogs.com/green/prod1.html part of the final url
and put it in a variable called $final_url.
So if I have :
Code:
$first_url = "www.example.com/sites.php?pd=45";
What would be the best way to get to that $final_url.
Should I be using cUrl or would
file() or get_file_conten ts() be able to get the url ?
Any ideas on how I can get to my $final_url ?
Comment