Ak Rotation Insolence Natacha's Blog Blessed Enchantement Reviews

Main

Home Site Miscellaneous

Graphics

Layouts Avatars Brushes Wallpapers Textures

Tutorials

HTML Layout CSS PHP

Affiliates

Deadly Nightshade

Apply? Linkage


Join Angel Knight's Rotation!
eXTReMe Tracker

 

PHP Includes

You will realize that after switching to php you will save A LOT of time on switching layouts and also adding a link in your navigation.
The main thing that we do in php includes in separate your layout in 3 files. a Header, "your content" and a footer. The thing is on everypage it will be the same header and footer but only the content will change. Witch will do that you will only have to go to the file called header or footer to edit your links or layout. =) Cool eh?
Know lets start by separating your header and footer from your coding. Open in notepad the code you have on your main page.
This is a example:

Know take all the coding OVER your first header and paste it into a new notepad. Save it as header.php.
A example:

Know take all the coding UNDER your content (after your last word) and copy+paste it in a new notepade. Save it as footer.php
An Example:

When you are finish this you can upload them onoto your server. Make sure there .php

When you are finish uploading you have to:

1) Change all of your pages from .html or .htm to .php
2) You have to do the following instruction to ALL of your pages:

You have to take out on your pages ALL the coding over the content (right before your first header). When your finish that you have to put this in it's place:

<?php include('header.php'); ?>

Then you have to take out on every page all the coding UNDER your content (after your last word) and put this in it's place:

<?php include('footer.php'); ?>

This is what it should look like:

<?php include('header.php'); ?>

All your content is here.=) blablablablabla

<?php include('footer.php'); ?>

When you are finish that it's all over! ^_^ Everything should work fine. But don't forget to change your links in your navigation too .php or it will end up with page not found.:P
Also please note that some free servers (like freewebs) don't let you change your pages to php. T.T

That's all!

If this tutorial really did help you, it would be really nice to credit us somewhere on your site.:)

Need Help with this tutorial?
Email Natacha at natacha@angelknight.net

Announcements

Sonic - Yes!! its a half decent sonic game that you can play online!

Sonic Yes!! Plus over 100 games !
Click Here to Play For Free
 


Join Angel Knight's Banner Exchange

View Credits