Forum Moderators: coopster
A dynamic site in 2 minutes [webmasterworld.com]
One of the true lifesavers of coding is the $includes file. It is also good design. The advice given here is to break things as much as possible so that only the stuff that is part of that page is on that page. All the stuff that spreads across pages is in a separate file that each page can load.
<!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>
<link rel="shortcut icon" href="/images/favicon.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="$$$$$$$$$$$$$$$$$$$" />
<meta name="keywords" content="$$$$$$$$$$$" />
<title>*******************</title>
<link rel="stylesheet" href="styles.css" type="text/css" />
<script type="text/javascript" src="nav.js"></script>
<style type="text/css">
#phases {
list-style-type: none;
margin-left: 0px;
padding-left: 20px;
}
</style>
</head>
<body>
<?php
include 'template.html';
?>
</body>
</html>
Am i doing this right? I saved the file as .php. The problem I am having is that my page is not being formatted with my external style sheet. Everything else seems to be fine, it is reading my external javascript file. Not sure what to do.
I haven't figured out how to separate the scripting from the HTML/CSS without doing individual .html pages, so until I do I've got them together and it works.
The template system I set up has a template.php set up with the entire page HTML/CSS code, with includes for the header (graphic, ets), side navigation and footer, and an include for the page content. I don't have to make any .html pages, using one line in .htaccess - just the one template and file.inc.php text files for the includes - it does it all, and works perfectly.
The only problem is that no other pages with the .html file extension can be in that same folder, because that template and rewrite will over-ride differently done pages in the folder.
I'm not sure which is the better way to do it, but until I figure out how to separate them, this will do.
If you separate the PHP from the html/css you still have to make separate .html pages for each page, right?
[edited by: Marcia at 6:54 am (utc) on June 11, 2008]