Thread: PHP Templating
View Single Post
Old 04-22-2007, 12:54 PM   #1 (permalink)
pea
Junior Member
 
Join Date: Jan 2007
Posts: 7
Default PHP Templating

Hello, I want to use headers and footers for my website but i'm having trouble with the title tags.

What i'm trying to do is put the page title into a variable on the contents page and then have the header echo it in the title tags.

The structure's like this:

contents page:

PHP Code:
<?php 
$title 
"title";
include(
"header.php"); 
?>
content
<?php include("footer.php"); ?>

header.php:

PHP Code:
<html>
<head>
<title><?php echo $title?></title>
</head>
</html>

But for some reason '$title' isn't echoing. Is there something i should be doing?

Thanks, Peter
pea is offline   Reply With Quote
Sponsored Links