Is there a variable to return the current title of the page?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MattSharp
Forum Commoner
Posts: 62
Joined: Wed Apr 24, 2002 2:25 pm

Is there a variable to return the current title of the page?

Post by MattSharp »

Like the part in the title bar at the very top of IE, or what goes in <TITLE> or something, I guess I could use the URL, how can you ge the whole URL of the current page, is it $REQUEST_URI ? Thanks....
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

hmmmm....you just generate the current page ;)
but the url of the page that has been displayed (and probably still is) may be stored in $_SERVER['HTTP_REFERER'] (or $HTTP_REFERER in older versions). $_SERVER['REQUEST_URI'] (or $REQUEST_URI) contains the link to your script. The client(browser) won't send you the content of it's current page.
Post Reply