Managing Title Tag with PHP

by Rekha 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>

Tagged in:

1033
like
0
dislike
0
mail
flag

You must LOGIN to add comments