Yes. Absolutely. You could even take it a step further and do this:
header.php:
Code:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta></meta>
<meta></meta>
<title><?php echo "$title"; ?></title>
<link href="css/reset.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/typography.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/forms.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
<link href="css/print.css" rel="stylesheet" type="text/css" media="print" />
</head>
<body class="<?php echo "$body_class"; ?>">
And in footer.php:
Code:
<div id="footer">
<p>My common footer.</p>
</div>
</body>
</html>
And then in index.php:
Code:
<?php
$title = "Home";
$body_class = "home";
include('header.php');
?>
<div id="content">
<h2>My index.php content</h2>
</div> <!-- end content -->
<?php
include('footer.php');
?>
And in about_me.php:
Code:
<?php
$title = "About Me";
$body_class = "about_me";
include('header.php');
?>
<div id="content">
<h2>My about_me.php content</h2>
</div> <!-- end content -->
<?php
include('footer.php');
?>
etc etc etc...
Bookmarks