<\/a> This week on The Killersites Forum Blog, we take a look at a really insightful post from the Killersites Forum<\/a> on how to create repeating sections of code on numerous pages.<\/p>\n Repeating Sections of Code On Many Pages <\/strong><\/a><\/p>\n Question:<\/strong>– I’ve got a site with 100 pages and I don’t want to edit the Answer:<\/strong>– Form one page complete in the normal way with the menu and Open up Notepad or a text editor (not Word) and cut the code that Substitute the code you have cut out with PHP code<\/p>\n in the main file and save it with .php filename extension instead of .html Do the same with other main pages where the menu repeats. If you use a complete page as an “include” file with .html or .htm for the You can have different “include” files on the same main pages for header The PHP code needs to be processed by a server before the result can SHTML works the same way but the “include” file must have .txt Check that your hosting service supports PHP or SHTML as free Stefan has 2 great video tutorials explaining exactly this in the PHP tutorials: PHP includes part 1<\/a> and PHP includes part 2<\/a> from the PHP Basics Course.<\/a><\/p>\n Not sure if this is in the videos – but it’s generally a good idea, especially if the site is set up with sub-folders, to use the absolute paths pointing to the include files, and for anything the include itself points to – that can save a lot of wondering why something suddenly isn’t showing up. <\/p>\n
\nHey Everyone,<\/p>\n
\nmenu on every page.<\/p>\n
\ncheck that it validates and displays properly.<\/p>\n
\nrepeats in every page completely (as much or as little as you want,
\nwithout doctype, html, head or body tags) and paste it into Notepad and
\nsave as an “include” file called menu.inc. You then have only one file to
\nedit if the menu changes.<\/p>\n
\nor .htm.<\/p>\n
\nYou can use .txt, .php, .html or .htm for the “include” file but it
\ndistinguishes it as an “include” file in your file list if you use .inc as the
\nfilename extension and it’s even better if you put all “include” files in a
\ndifferent directory\/folder.<\/p>\n
\nfilename extension the final processed page will have two doctypes, two
\nhtml tags, two head sections, etc. in an unusual place which is not a
\ngood idea.<\/p>\n
\nand footer and even use “includes” for the parts of the head section that
\nrepeat.<\/p>\n
\nbe seen, either by the hosting service’s server just before downloading or
\nby a server like WAMP (which includes Apache) on your computer for
\nlocal viewing.<\/p>\n
\nfilename extension and the main pages have the code and the .shtml filename extension.<\/p>\n
\nwebspaces provided by ISPs usually do not.<\/p>\n