Reply
Old August 4th, 2005 Top | #1
 
penguin's Avatar
g0t r00t?
Joined: January 2004
Posts: 101
Reputation: 90
Power: 100

Default php: Dynamic Titles...

How would I go about doing dynamic title with php? I would like it so that the page title would be the name of the page being called.

for example.

http://www.mysite.com/?p=about Would be titled About.

penguin is offline   Reply With Quote
Old August 4th, 2005 Top | #2
 
SPeedY_B's Avatar
I may actually be insane.
Joined: March 2002
Location: Midlands, England
Posts: 15,800
Reputation: 2877
Power: 307

Default Re: php: Dynamic Titles...

PHP Code:
<title>Site Name <? if (isset($_GET[p])) { print " - $_GET[p]"; } ?></title>
You can use ucwords(); to make things a bit neater too.
SPeedY_B is offline   Reply With Quote
Old August 4th, 2005 Top | #3
 
penguin's Avatar
g0t r00t?
Joined: January 2004
Posts: 101
Reputation: 90
Power: 100

Default Re: php: Dynamic Titles...

Thanks S_B.

How exactly would I use the ucwords(); ? (I know enough php to be dangerous:P)

penguin is offline   Reply With Quote
Old August 4th, 2005 Top | #4
 
SPeedY_B's Avatar
I may actually be insane.
Joined: March 2002
Location: Midlands, England
Posts: 15,800
Reputation: 2877
Power: 307

Default Re: php: Dynamic Titles...

Like so:
PHP Code:
<title>Site Name <? if (isset($_GET[p])) { print " - ". ucwords($_GET[p]); } ?></title>
SPeedY_B is offline   Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
UK gamers spend £1.5bn on titles Dark Atheist Green Room 2 December 20th, 2007 7:47pm
Reply Titles FishBoy Site Problems & Feedback 7 January 20th, 2005 8:10pm
How to remove toolbar titles? tkole Windows Desktop Systems 5 November 16th, 2002 11:23am
titles... dArK_CyAnIdE Site Problems & Feedback 15 May 7th, 2002 4:51am
Book titles, you made yourself. Kirrie2001 Funny Farm 7 April 16th, 2002 4:07am