Php Lesson 4:- Server Side Includes
(269 reads)
Server Side Includes
You can insert the content of one file into another file before the server executes
it, with the require() function. The require() function is used to create functions,
headers, footers, or elements that will be reused on multiple pages.
This can save the developer a considerable amount of time. If all of the pages
on your site have a similar header, you can include a single file containing
the header into your pages. When the header needs updating, you only update
the one page, which is included in all of the pages that use the header.
Example
The following example includes a header that should be used on all pages:
<html>
<body><?php require("header.htm"); ?><p>
Some text
</p><p>
Some text
</p></body>
</html>
|