Include Files

On this article, I will explain how to use Include files on Html, Asp, and Php files.  Most of the paid hosting companies allow you to use include files.  It is one of the best ways to control your fully loaded website.

Include files in Html

In html, you can use a simple code to include a file in another one.  So let’s say you have index.html and you want to add menu.html as an include file; so you would open the source code for index.html and add the following code:

<!--#include virtual="menu.html" -->

If you add this code to your index.html’s source html code and it doesn’t work, don’t give up.  Most hosting companies allow to add include files to only .shtml files.  So what you is easy and simple, just rename your index.html to index.shtml

Include files in Asp and Asp.NET

In asp it is very easy to add an include file to your source codes.  It is just like the code above for Html files but in a different words.  The code is:

<!–#include file=”example.asp” –>

YES! there is only one word difference.  Instead of “virtual” your going to use “file” to include a file.

Include files in Php

Include files in Php is the same concept.  The code is below:

<?php include("example.php"); ?>

You can use any type of files you wish to include.  If you have a page named menu.html  you can include this page into your Php or Asp coded page.  For example:

<?php include("menu.html"); ?>

Comments

One Response to “Include Files”
  1. seoblogcentral01 says:

    great collections

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!