Managing Title Tag with PHP
by Rekha[ Edit ] 2009-11-20 11:45:41
You can use php define function to define a title tag and defined() is used to check whether a given named constant exists.
//require the header file
require('require/header.php');
//rest of code here
//require the footer
require('require/footer.php'); ?>
then you replace the title tags in require/header.php with:
<title><?php if (defined ('TITLE')) {
print TITLE;
} else {
print 'Site Title Not Set.';
}
?></title>