PHP, which stands for
Hypertext Proprocessor, is a commonly used scripting languages used in websites. PHP is rather useful if you want a quicker way to buildup your website layout. This tutorial will teach you how to do that the simple way.
Now, say this was my layout code:
<head>
<title>TITLE<title>
</head>
<body>
<!--Content here-->
<h1>BLAH</h1>
blaaaaaaaaaaaaaaaaaaaaaaaaaah
<!--Content end-->
<!--Navi-->
<h1>TITLE</h1>
<a href="#">BLAH</a>
<!--Navi end-->
</body>
First, create the files:
header.php and footer.php.
Make sure all of your pages you want to use PHP in ends in .php. But first
check if your web host has PHP support. If not, you can't use PHP. Then,
copy and paste the codes
ABOVE the content into the header.php file.
After, copy and paste all the codes
BELOW the content in the footer.php.
Then, you MUST add include codes, which will magically form your layout.
Look at the example below:
<?php include('header.php'); ?>
<!--Content here-->
<h1>BLAH</h1>
blaaaaaaaaaaaaaaaaaaaaaaaaaah
<!--Content end-->
<?php include('footer.php'); ?>
Only the content appears with out a
<head> </head> tag, and the PHP includes.
Put the PHP includes on all the pages you're using php, and it'll make your time easier.
All you have to do (in this case of my codes) all I have to edit for the navigation is the footer.php!
Such an easy task, isn't it? Now you try it :3
Contact me if you have problems/errors/or questions about this tutorial, or if you need help ^^