PHP Includes
PHP includes are used to include information from one file into another and makes your website easier to maintain.Change the extension of all your website files to .php Example: index.html to index.php, site.php and so on.
There are three parts to a PHP file; the header, the content and the footer.
Create 3 new files and name them header.php index.php and footer.php
Basic HTML PAGE
<html>
<head>
<title>web page title</title>
</head>
<body>
ALL YOUR CONTENT HERE. UPDATES, SITE INFO, CONTENT...
</body>
</html>
Basic Header Page
The following goes into your header page (header.php).
<html>
<head>
<title>web page title </head>
<body>
NOTE: IF YOU ARE USING DIV LAYERS PLACE ALL THE LAYOUT CODE HERE!
Basic Index Page
The following goes into your index page (index.php)
ALL YOUR CONTENT GOES HERE, UPDATES, BLOGS, WHATEVER YOU WANT!
Basic Footer Page
The following goes into your footer page (footer.php)
</body>
</html>
Adding the Includes
Replace "replace_here_with_absolute_path" with you absolute path.
Tutorial can be found here.
<?php include('replace_here_with_absolute_path/header.php');?>
Add the above code at the top of your page.
<?php include('replace_here_with_absolute_path/footer.php');?;>
Add the above code at the bottom of your page.
Save it as index.php and upload all 3 files (header.php index.php and footer.php)
Now go to http://www.yourdomain/index.php to test it out.
If you have any questions email me at visabellad@gmail.com


