PHP: Include
PHP gives the ability to include contents of other files in your current file. Therefore, it is a usual practise to create a header file and call it header.php and inclde it in all consecutive files to ensure that the header of all your website looks consitent.
Example:
header.php
|
<a href="home.php">home</a> <a href="tutorial.php">tutorials</a> |
Now, the contents of this header.php can be included in any other page. Example index.php is:
|
<html> <body> <?php include ("header.php"); ?> <p> Hi This is a practise page!! </p> </body> </html> |
Now, the user would see the following code:
|
<html> <body> <a href="home.php">home</a> <a href="tutorial.php">tutorials</a> <p> Hi This is a practise page!! </p> </body> </html> |
And the output would be:
This would give following output:
Same thing can be repeated for normal menus and footers.

Recent comments
22 weeks 4 days ago
23 weeks 1 day ago
23 weeks 1 day ago
23 weeks 3 days ago
24 weeks 1 day ago
26 weeks 2 days ago
29 weeks 2 days ago
32 weeks 1 day ago
32 weeks 6 days ago
33 weeks 5 days ago