View Full Version : alternative to cut and paste

11-15-2011, 07:23 PM
I use an image at the top of a dozen or so pages - rectangular coordinates are used to select the page

<area shape="rect" coords="150,200,300,250" href="general_ledger.html" alt="" />
<area shape="rect" coords="300,200,450,250" href="checkbook.html" alt="" />
and so on....

I paste the same dozen dozen lines at the start of the body of each page

I also have a footer which is the same for each page - again, I paste the code to each page

there must be a better way - can someone point me in the right direction

11-15-2011, 07:50 PM
Do a search for "PHP Include" or "Server Side Include" - that's what you want.


11-15-2011, 08:57 PM
Dave is right, I would suggest using a server side include. That way, you'll modify it once to make the changes across the site.

11-15-2011, 10:53 PM
Hello carl47,
Here is an easy to follow totorial on php includes - http://www.tizag.com/phpT/include.php

11-21-2011, 04:00 PM
just getting "include/require" working - thanks to all for pointing me in the right direction

but... now looking at WC3 validation and <?php require("menu.php"); ?>

for page.html and HTML 5 and no <?php I get 1 warning

for page.html with <?php I get 1 warning and 1 error for the <?php and page.html does not bring in the menu code

for page.php with <?php W3C tells me the doc cannot be checked, but the menu code is properly applied

it seems like every page with <?php must have a php extension, but the WC3 validator does not seem to like .php - where now?

11-21-2011, 04:04 PM
W3C tool validates the HTML generated code, not the server-side languages code :). If you want to validate something, validate what you see when you open View Page Source.

11-21-2011, 04:32 PM
yes - I understand what you mean and it works fine!

11-29-2011, 11:00 PM
Guys -

Once again wanted to thank all of you! I am not a master of HTML5 - and will only use it for my own web site - but I have developed a reasonable understanding of boxes, divs, tables and lists to send my php files to the W3C as htm and feel confident they validate without any issues other than those arising from my php header and footer.

Eventually I would have figured it out on my own. But, you probably shaved six months off the experience.:)

Once again - Thanks