Ah, yea this is a common way of not repeating yourself when creating pages. So all you have to do is have the code exactly as it was before but in the other files. So let's say header.php contains the following:
Code:
<html>
<head>
<title>My site name</title>
<link rel="stylesheet" type="text/css" href="styles/public.css/>
</head>
<body>
and then the footer.php contains:
Code:
<div id="footer"> Copyright © </div>
</body>
</html>
Remember that you will have to rename your HMTL files to PHP files for the includes to work:
Code:
<?php include("header.php"); ?>
Content Here...
Bla bla <div> </div>
Etc...
At the end of the page now...
<?php include("footer.php"); ?>
And then you can always include another php content file mid way down if that is going to be repeated, hope you see how it works now,
Jack.
Edit: You could even add in a bit of dynamic content by setting your <title>My site name</title> to a variable (if it is a value that changes). So <title> <?php echo "$title"; ?> </title> and then set the title variable in the HTML file, like $title = "About";
Bookmarks