10Oct/092
PHP Include
The include command can save you a lot of time as you can create a header, place it in a file and just include that file on every page and the header will be shown. This will also mean that you do not need to edit every page every time you need to edit your header!
Basically the PHP Include command takes the file name and inserts the contents of the file into the script.
To illustrate this, I will use an example:
- Create a HTML file called Menu.html and insert the following code into it:
<ul> <li>Home</li> <li>Articles</li> <li>Tutorial</li> </ul>
- Now create a menu_example.php PHP file (in the same directory as Menu.html) and insert:
<?php include(‘Menu.html’); ?>
- Navigate to menu_example.php in your browser and run it – you should see:

- Menu Included.
October 22nd, 2009 - 20:23
Hello from Russia!
Can I quote a post in your blog with the link to you?
October 23rd, 2009 - 09:16
Yes, for sure.