PHP Inclusion
Basically, PHP inclusion is when you include a working file into your PHP.
First open your .html file you have already completed.
Usually the area of HTML you will not be editing on every page--such as the navigation--will be lodged into one seperate file, so you don't have to code every single page!
Take note that in PHP, you can have fully all HTML as well, but you use PHP to make life easier.
Basically, here is an example of the coding you take out, and put it into a file.
<? include ("nav.txt"); ?> is the PHP inclusion code.
Inclusion is pretty simple, thus, very straight-foward. nav.txt is the file you will be putting all your coding that will be repeated in all your site's pages. In this case, I named it "nav" for navigation since the nav for all the pages are the same.
You may put the code anywhere in your code as long as your coding is saved in the right file. Since Notebad is the universal place to script your massive amount of HTML--not including programs like Dreamweaver--it is only natural for the format extention to be .txt for Notepad.
For example:
this is what your coding looks like ---> a b.
Now with <? include ("nav.txt"); ?> in the front of the .php file, it will look like b with the inclusion code.
You may have the same inclusion code in the beginning and end of your PHP file. Your .txt file names will be different (the coding will be different, assuming) and also assuming that the area you do want to change in every other page will be the content (the remaining HTML).


Home | Site Information | Policy and FAQ | Linkage
Site and layout is © to Heidi Hu. All tutorials, information and items are copyrighted to their rightful owners. All rights reserved.
Valid HTML 4.0 Transitional Valid CSS!
eXTReMe Tracker