Hi,
Something that would be really useful for a new project im working on would be to have automated browser titles using some php code in the <title> tags.
The only way I can think of doing this is by having the php code read the url im using for navigation, e.g. /windows/atari2600/ and use that data, edit it and have it display as 'Windows > Atari 2600'
Has this kind of thing been done before? are there any other common ways of doing this? Also are there any tutorials around?
Thanks!
Is this possible? (automated browser title)
Moderator: General Moderators
- Josh1billion
- Forum Contributor
- Posts: 316
- Joined: Tue Sep 11, 2007 3:25 pm
Something like Wikipedia articles?
That'd be pretty easy really...
Hope that helps. 
Note: for parsing the $url variable, you may want to look into the functions strstr() and substr()
That'd be pretty easy really...
Code: Select all
<?php
$url = $_SERVER['SCRIPT_NAME']; // if I understand this line correctly, this would be "/server/atari2600" in your example
// you can parse $url here into the different words if you like.. I would suggest you use an underscore ( _ ) for spaces, so you'd have /server/atari_2600 instead
print "<title>$url</title>";
?>Note: for parsing the $url variable, you may want to look into the functions strstr() and substr()