288
Include External Files ............................................
4 In your editor, open the file
into which you want to
include the file created in
Steps 1 to 3.
5 In the file at the point at
which you want the include
to appear, type <?php.
1 In your editor, open a new,
blank file.
2 Add the HTML you want to
have in the include file.
Note: This should not be a
complete file, so the basic HTML
structure tags should be omitted.
3 Save the file into your Web
server’s root directory.
Include External Files
M
anaging shared assets such as common headers and navigation is a problem Web designers
have faced since the medium’s earliest days. Dynamic processing of pages offers a very useful
solution via includes. An include is simply a directive for PHP to include the contents of a file into
another file when it is processing the page. This way, you can have a common element such as your
navigation in an independent file that is included into each of your other pages. When you need to
update the navigation, you simply modify that one file.