Page 1 of 1

Getting the URL of the calling page

Posted: Wed Oct 23, 2002 1:17 am
by uncertain_manos
Hi there,
I am very new to PHP, but I want to use it for making simpler my pages.
My problem is the following:
I have a header frame of which's the contents I want to change each time the user clicks another link. So I planned that it will call the header.php, in which according to the URL clicked, will provide the respective content. I am now stuck at how I can get the URL of the link that the user will have just clicked. That is, I want to get the URL of the new link that the user navigates, and thus produce the needed header.
Although I cannot be sure, I have a feeling that the URL is an information that can be shared just as the HTTP_USER_AGENT variable.
Thanks beforehand for your help,
Manos

Posted: Wed Oct 23, 2002 1:59 am
by Jay
You'll need javascript for that, it's got nothing to do with PHP.

Getting the URL of the calling page

Posted: Wed Oct 23, 2002 2:14 am
by uncertain_manos
Thanks.
But I still wonder, how it is possible to get the information about the browser type through PHP and not get the URL. Aren't both of them information that ends to the server, and thus both capable of further use?

regards,
Manos

Getting the URL of the calling page

Posted: Wed Oct 23, 2002 3:03 am
by uncertain_manos
Finally I found the answer
To anyone that is interested, you can use the $HTTP_REFERER and this will give you the URL of the page from which the user came into yours.

Re: Getting the URL of the calling page

Posted: Thu Oct 24, 2002 1:57 am
by Jay
uncertain_manos wrote:Finally I found the answer
To anyone that is interested, you can use the $HTTP_REFERER and this will give you the URL of the page from which the user came into yours.

That's the page from where the user came to the called page. And the full reference is $_SERVER['HTTP_REFERER']