It is currently Fri Jan 19, 2018 3:48 pm


All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [PHP] Dynamic Title Script
PostPosted: Sun Jan 15, 2006 5:48 am 
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


Top
  
 
 Post subject:
PostPosted: Mon Jan 16, 2006 3:37 am 
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 :)


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ]  Moderators: fhmagic, KJ, Support Team, Moderators

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
100WebSpace © 2011