How to get URL address of redirected page?
Posted: Sat Nov 05, 2005 8:32 am
Hello,
I have written codes which read url from a table and redirect to the address.
For example, when id number 3274 is passed,
http://www.sample.com/process?id=3274
This will search the relevant url address from a table(let's say, 3274 is http://www.yahoo.com),
and redirect a user to the address.
Therefore, the user who runs "http://www.sample.com/process?id=3274" will be redirected to
http://www.yahoo.com
My question is how do I code to retireve that URL addres, "http://www.yahoo.com" when coding.
I mean assuming that I cannot refer to the table.
So, I would like to know how to code to retrieve the url address after redirection is occured(it will be "http://www.yahoo.com" from the above sample), assuming that I only know the url address which will redirect itself to other address(it will be "http://www.sample.com/process?id=3274" from the above sample).
Is there a Php function for this?
I would really appreciate if some one can help on this.
Many thanks in advance.
I have written codes which read url from a table and redirect to the address.
For example, when id number 3274 is passed,
http://www.sample.com/process?id=3274
This will search the relevant url address from a table(let's say, 3274 is http://www.yahoo.com),
and redirect a user to the address.
Therefore, the user who runs "http://www.sample.com/process?id=3274" will be redirected to
http://www.yahoo.com
My question is how do I code to retireve that URL addres, "http://www.yahoo.com" when coding.
I mean assuming that I cannot refer to the table.
So, I would like to know how to code to retrieve the url address after redirection is occured(it will be "http://www.yahoo.com" from the above sample), assuming that I only know the url address which will redirect itself to other address(it will be "http://www.sample.com/process?id=3274" from the above sample).
Is there a Php function for this?
I would really appreciate if some one can help on this.
Many thanks in advance.