Hi Steve,
That is a great start to your newly updated site. It already looks nice and clean and easy to look around so don't add too much more to it. For example you don't actually need boxes around content all of the time, so as long as the different areas of the page are separate enough that the user can easily identify them individually, and what each is for (navigation, main body content, advert links, header etc) then you are fine.
Regarding creating a way to distribute common content across all pages from one source, yes this is very easy to do using php. With php you are basically still creating html pages, but do make sure they are xhtml pages these days, and utilise css style sheets to format the page and avoid using any properties within html tags themselves.
Firstly XHTML. All this actually means in its most basic description is standardisation of html syntax and formatting. With html 4 many sites might have upper case html code, which is not good as all browsers and other technologies accessing it won't always work with them. All must be lowercase. In addition all html tags much be closed. Again in html 4 a lot of people never bothered closing tags, so you might have found a paragraph < p > tag, but no < / p > tag. This has to be included now. And if you have single html tags that don't surround content then you close the main tag itself. For example < br / >. Hope that makes sense?
I can help you with your site and coding structure as you build it if you would like?
Site templates
Creating a site template s is how you would put all common code into single files, and then call the rest of the site pages from it.
Firstly we have a single page called index.php which the whole site will run from. This file contains all of the site design and layout, and within in contains placeholders that call the actual content to load into the positions from variables.
When loading page content into the main index.php file we would use a variable and php include code.
So your index page would contain the normal html code laying out the page. Then create each page/s content in separate files f.ex
Code:
pages/home.php
pages/about.php
pages/news.php
Then in the body of your main index html page you can setup some php code to call these to load the content one into the page at the correct position. For this we would use the php include code.
Code:
</php include("page/home.php"); ?>
However, that is only useful for a single hard coded page. To utilise loading all pages into the single template index.php page we would need to test for and retrieve a variable from the url. For example we could call the variable p and load pages by using index.php?p=about
Firstly in the position on the page where we want each page's content to load, we would use a variable. So
Code:
</php include("$currentpage"); ?>
Next we have to generate the page held in that variable from the url string. So at the top of the index.php file we can add some more php code to do this. Here is a very basic method to get you started.
Code:
<?php $currentpage = $p . ".php"; ?>
This takes the p=pagename from the url ad automatically uses what it equals as the variable contents. And this code adds .php to the end of it and sets the $currentpage variable. So for example if the url was index.php?p=about, then this would make $currentpage = about.php and so it would then load this file into the include location within the index.php file where you place the include.
If you have all your pages in a sub directory called pages then you would use
Code:
<?php $currentpage = "pages/" . $p . ".php"; ?>
As you can see, php uses . as the concatenation operator to join strings together into a single variable.
Hope that makes sense. This is just a very basic beginning. Try it out and once you get includes working I could introduce you to adding code needed for error checking, so the server will first test to see if the page called from the url string exists before loading it, so you don't get error pages. As well as other better methods of retrieving the variable from the url.
Also I also always break the index page up even more, creating separate pages for each part of it, so I would have a navigation.php file in the template directory and this would just hold the navigation part of the page, which would then be loaded into the index.php page with an include. This allows the index.php page to contain just code and layout, and no content at all.
Hope that all made sense?