Posts Tagged ‘
PHP Script ’

As I have created more websites, I have come to love includes. They are useful when you need to use one file repeatadly. For instance, you may want the same navigation scheme across a site. It would be troublesome, or bothersome to insert you navigation code on each page.

What happens when you add or subtract a page? You would have to change every single page. 9 times out of 10, you always miss at least one page. There are other situations where using an include would come in handy, but those are more programming oriented.

This code requires the use of PHP, on the main page you need to write, and so this page must end in .php, for example, index.php. The ending php tells your server it needs to do more work with that page before displaying it.

Whenever you are using a PHP tag, you must enclose it in

<?php **Place Code Here** ?>

On the every page you want this content to appear insert the code:

<?php include(“file directory here/link.html”); ?>

This tells the server to include “file.html” in that place on the page. Now, you create “link.html”.