Forum Moderators: coopster
In my title on my header.php file i have something that looks like this <title>abc 123 <? echo $title;?></title>.
On all my other pages, on the top of each page, i have <? $title = ''; include "header.php";?>.
The way my site works now is that every page i go to has the same title and meta tags. I would like to change it so i can have different title on each page.
Im sure this is pretty simple to do, I just don't know how to do it.
Thanks
Bob
<?
function do_html_header($title)
{
//formats a nice header
?>
<html>
<head>
<title><? $title?></title></TITLE>
</head>
<BODY>
<H1>Your site name</H1>
<HR>
//custom heading will be printed here via do_heading call
<?
if($title)
do_html_heading($title);
}
function do_html_footer()
{
// print an HTML footer
?>
</body>
</html>
<?
}
function do_heading($heading)
{
// print heading
?>
<h3><?=$heading?></h3>
<?
}
You can include all 3 of these functions in one include or require statement. Coding your pages becomes simplicity itself.
<?
require_once("html_fns.php");
do_html_header("Using Includes for Page Layout");
?>
<P> Your content here </P>
<?
do_html_footer()
?>
Hope this is of some help.
WBF