100 Web Space
http://forum.100webspace.com/

[PHP] Dynamic Title Script
http://forum.100webspace.com/viewtopic.php?f=13&t=3482
Page 1 of 1

Author:  rm249 [ Sun Jan 15, 2006 5:48 am ]
Post subject:  [PHP] Dynamic Title Script

Hello everyone, I have created a dynamic title script for those that want to use PHP and comapre certain variables to a title name to get a page title

In this example, you are comparing the title from a list of arrays from the PHP_SELF command.
Code:
<?
/*
PHP Dynamic Title
Author: rm249
Site: http://www.rm249.com/
*/
// Setting the variable $x to $PHP_SELF
$x="$_SERVER[PHP_SELF]";

// Site absolute path (if root, leave blank)
$abs_path = "";

// Title  variable list (copy and modify for each title
$title_var["$abs_path"."/index.php"]="Home";

// Setting the title to whatever the variable is for $PHP_SELF
$var_1=$title_var[$x];

if ($var_1 == ""){
$title="(!PAGE_TITLE_NOT_AVAILABLE!)";
} else {
$title=$title_var[$x];
}
?>


I use this on rm249.com, rm249.net, and have modified it for Hubi to use on hlgamer.com as well. I know there CAN be imporvements on it, but.... maybe I will get to it later ;)

RM249

Author:  rm249 [ Mon Jan 16, 2006 3:37 am ]
Post subject: 

When I created it I just made it real fast for my needs. Now that I am sharing it, I have thought about using it with a MySQL database, I just have not had the time to program it for that. Maybe in the near future I will release an updated script with MySQL support :)

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/