Re: [Hampshire] [OT]Quick web question

Top Page

Reply to this message
Author: Mark Johnson
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] [OT]Quick web question
>
> Sorry for the silly question, I am set here playing with my web site as I
> watch the rain fall
>
> I have a web site and my pages are made up of three columns, left, middle
> and
> right
>
> Most pages are php (index.php) named pages (all displayed in the middle
> column) as they call html files to build the complete page, left.htm and
> right.htm are two such files as they carry the same information on every
> page
> on the site (which is why I did it this way).
>
> My question is does left.htm and right htm have to be complete with the
> full
> headers like <!Doctype> <head> <meta> <body> etc. or can they be left off
> as
> the middle column has the full headers?? For example in left.htm the first
> line of code is<h1>


I'm afriad neither is correct.
If you have your page with the three columns (let's call it index.php)
that includes left.htm, right.htm and center.php.
When you call index.php it includes the 3 other documents with any output
from index.php and returns it to the browser. Say the page looked like
this:

<html>
<head><title>index.php</title></head>
<body>
<div id="left">
<?php include('left.htm'); ?>
</div>
<div id="center">
<?php include('center.php'); ?>
</div>
<div id="right">
<?php include('right.htm'); ?>
</div>
</html>

When the script is run, the output (the code above plus the code from the
included documents) is treated as one document to be rendered/validated.
This means that the headings only need to be placed at the top of
index.php, or perhaps in a seperate include that is included before the
body of the page.

Placing the DTD, <head>, <title> and <meta> tags in any of the included
documents would mean they appear in the body of the document, where they
would break validation.

HTH,
Mark

>
> Tim
>
> --
> Please post to: Hampshire@???
> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
> LUG URL: http://www.hantslug.org.uk
> --------------------------------------------------------------
>