PHP Includes
fleurchild.com > Resources > Tutorials > PHP Includes
PHP is a scripting language, based of that, PHP Includes is very useful for people who frequently change their website layout.
Conversion
All you simply need to do is to change the filetype. This can be easily done on your FTP server software. Just right-click the .txt file and rename it as NAME.php!
Layout
Firstly, create a file for your layout. Just include the parts you want to be on every single page, meaning no actual content. You must include the layout,the main links, and the stylesheet. Also remember not to be put any ending codes where the content text goes.When you are completed name the file: layout.php
Getting the .php file extentions
You can pretty much change the file name to .php, but when you have a lot of pages, that's pain in the ass.
Here's a better alternative: Notepad ++. Notepad ++ is similar to the functions of Microsoft Notepad, but much more advanced - you can save files in many different file extentions, like .php!
Getting the layout on EVERY page
All you simply have to do is add this above your site's content.
<? include("layout.php"); ?>
Remember to also save every page you have as a .php file!
...& your done!
Example
<? include("header.php"); ?> <html><head></head><body></body></html> <? include("footer.php"); ?>
to fleurchild.com, Julia's little corner of the webernet. Be sure to check out the many high-quality resources the site has made availible for you. If you have a request of any kind, don't be afraid to from me a message in the blog. Back to the Top.
