An Include File is basically a commonly used file or section of code or division, such as a navBar or mastHead or Footer that can be added or included to each of your Web site pages so that it can be reused over and over. Include files allow you to use modules that can make the code of your main pages appear smaller and easier to read. But more importantly, any changes made to the include file will be quickly and easily propagated throughout the entire web site without having to edit every single page.
A single line of script, from Server Side scripting languages such as
PHP is a free server-side scripting language originally designed for web development to produce dynamic web pages. PHP code can be embedded into the code of a normal HTML Web page. PHP originally was an acronym for "Personal Home Page." However, it is now commonly referred to as "Hypertext Preprocessor."
PHP files have a .php file name extension. , ASPASP
ASP or ASPX are file extensions for an ASP.NET Active Server Pages. It's a scripting language or web technology used on Microsoft servers running Internet Information Services.
ASP files have an .asp or .aspx file name extension., Cold FusionCold Fusion
Cold Fusion is a full and powerful scripting language now owned by Adobe, and integrated with Dreamweaver.
Cold Fusion files have a .cfm file name extension., or SHTMLSHTML
SHTML stands for Server-parsed HyperText Markup Language, which allows simple server side commands, such as Server Side Includes.
SHTML files have .shtml, .shtm, or .stm file name extensions., is used within the main pages to call the include files. Each of your main pages will have to be renamed with the scripting language's extension, for instance index.php, portfolio.php, and contact.php. Include files are Server SideServer Side
Rule one: Your remote server must support PHP, or Cold Fusion, or ASP, or SHTML. Most hosting companies support PHP and SHTML, but call your provider and confirm. (Or upload a very small .php test file that calls an include file, and also upload the include file to confirm.)
Most Windows based hosting sites support ASP or ASPX, but call your hosting provider and confirm.
Many companies, such as GoDaddy, may have a modest yearly charge for Cold Fusion (.cfm).
Rule two: All files calling the include file, such as your index page, your Portfolio page, your Contact page, must have a .php extension, or .cfm, or .shtml, or .asp (but do not mix scripts and extensions).
Step 1a. Create your Include File
For instance, build the Nav Bar shown below, (navBar.htm) or MastHead (mastHead.htm)...
(Note: there is no other code needed for navBar.htm, only the four lines of code shown below.)
Step 2a. Create your Content pages, such as index.php, portfolio.php, and contact.php...
Step 2b. Call the Include file from your Content pages:
For instance, in the exact area where you used to have the navBar tags and code add:
Step 3. Upload all the files to the Web site. That is upload: navBar.htm and the files that call it, such as index.php and contact.php, or index.cfm and contact.cfm
Note 1: When you view the source remotely online (at the server side) both files (navBar.htm and index.php) are displayed as one file. A person who chooses View > Source from the browser cannot tell whether or not an include file is used.
Note 2: You can locally view each of the include files on your desktop browser (such as navBar.htm) on your computer if you give them .htm extensions. However, you cannot view .php, .cfm, or .asp files locally on your desktop browser without special software installed on your computer.
For more HTML code samples see: www.w3schools.com
For other resources and tutorials see: quackit.com and htmlquick.com
Validation checks the syntax of your file, looking for both errors and possible issues when viewing your page in a browser. Some of the problems reported are missing end tags, missing characters, invalid attributes, incorrect nesting of elements... your file, see: http://validator.w3.org
Review Assignment Learning Project: 10 Practice Review Steps