Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Getting the URL of the calling page

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Getting the URL of the calling page

Postby uncertain_manos » Wed Oct 23, 2002 1:17 am

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
uncertain_manos
New php-forum User
New php-forum User
 
Posts: 31
Joined: Wed Oct 23, 2002 12:55 am

Postby Jay » Wed Oct 23, 2002 1:59 am

You'll need javascript for that, it's got nothing to do with PHP.
Jay
 

Getting the URL of the calling page

Postby uncertain_manos » Wed Oct 23, 2002 2:14 am

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
uncertain_manos
New php-forum User
New php-forum User
 
Posts: 31
Joined: Wed Oct 23, 2002 12:55 am

Getting the URL of the calling page

Postby uncertain_manos » Wed Oct 23, 2002 3:03 am

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.
uncertain_manos
New php-forum User
New php-forum User
 
Posts: 31
Joined: Wed Oct 23, 2002 12:55 am

Re: Getting the URL of the calling page

Postby Jay » Thu Oct 24, 2002 1:57 am

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']
Jay
 


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.