PHP Includes « Thread Started on Jun 30, 2005, 12:23am »
Okay here is an easy and short tutorial on how to use PHP includes for your website.
1. Copy and paste the top half of your site into notepad and save it as HEADERS, basically everything from the beginning to the start of your content for that page.
2. Copy and paste the bottom half of your site into notepad and save it as FOOTERS, basically everything from the end of the content for that page to the bottom.
3. Now that the top of your html for that page is deleted, you must put this code on the top...
<?php include('header.txt'); ?>
4. And you put this in the bottom...
<?php include('footer.txt'); ?>
5. After that make sure to save the page as PAGENAME.php
6. Also make sure that when you are saving, where it says SAVE AS TYPE, that you put ALL FILES, so it will save as a php file and txt.
And then you're done! Remember to save all of you all your file extensions to PHP and links.
EDIT// you can actually also save your index as php too, so do everything the same for ALL pages. And you can save the Header and Footer in php, just remember to change the ending in the code above!
Wonder what the use for this is?
It's to call certain files to certain places on a website. With this method, its being used to easily change the header and footer from one single file, rather then multiple files and messing things up.