Advantage of PHP Include Page in Web Page Design

PHP include page statement is an extremely usefulIf you include a text or an HTML file, content of that
statement to build your Web pages. If you are veryfile will be directly added to the parent file at the
new in PHP or even don't know it at all, you can alsopoint where you put the include statement. But if
utilize this statement to manage your website.you include a PHP file with include statement the file
Logically you can divide HTML code of a web pageto be included first compiled and then added to the
into multiple segments. Some of those are staticparent file. If any error generated during compilation
parts and others are variable parts. Static parts arePHP will generate an error message.
those which do not change from page to page, i.e.How to utilize PHP include file?
top part of your page where you put your site nameTo utilize include file statement you keep the static
and banner, menu, bottom part of your page whereparts of your HTML code in separate files, say
you put copyright notice, etc. Variable parts of yourmenu.html, footer.html, top.html etc. For your
page are the elements which vary from page toconvenience keep those files in a separate include
page, i.e. your page title, descriptions, keywords,directory. When you create a new web page write
content of your page etc. When you create a newyour HTML code as usual but when you need to
web page you have to write entire HTML code bothwrite the static part HTML code you just put PHP
for static and variable parts of your page. Now if youinclude file statement to add those codes. So the
want to add a new link to the menu or if you like toresulting file becomes smaller and hence easier to
change your site banner then you has to edit allmaintain. Also you can edit the static part code by
HTML files you have already created. It is almost anediting only a single file.
impossible task if your website contains fifty pagesPoint to remember: You can use include page
or more. PHP include file is the ideal solution for thisstatement to include HTML or PHP file, but the
problem.parent file where you put the include statement must
What is PHP include page statement?be a PHP file. So when saving that page use .php
PHP include statement adds the content of the file toextension.
be included at the point where you put thisAdvantages of PHP include page
statement. This statement takes only one argument,
file name you want to include. The form of the1. Resulting page is smaller. So smaller web space
statement is:required.
2. As codes are divided into multiple segments so it is
To include a file say menu.html use the followingeasier to maintain. Finally PHP is free software. So no
command:extra cost you require to get PHP.