View Single Post
01-12-2011, 02:33 AM
#4
Eightloop is offline Eightloop
Eightloop's Avatar
Status: Member
Join date: Jan 2011
Location:
Expertise: Programming, photography
Software: Notepad++, Photoshop
 
Posts: 112
iTrader: 0 / 0%
 

Eightloop is an unknown quantity at this point

  Old

Oh I know what you mean now! You will need to use a function called include().

Here's a very(!) basic script with 3 files:

header.php, a file with the top navigation, etc.
content.php, a file for the content
footer.php, a file for the bottom, copyright, etc.

Put in the header file everything that stays the same for every page. Usually, this goes until the content comes.

In you header file you put write:

PHP Code:
<?php include('header.php'); ?>
<!-- This code above will include the header.php file -->

<!-- Below is your content -->
<div>Your content!</div>

<!-- The code below include the footer.php file -->
<?php include('footer.php'); ?>
This is a very basic way to achieve that. If you want to change something in your navigation, just change your header.php file once.

Of course there are much more elaborate ways, but this should do the job for a simple website.

Best of luck with your website!
Michael

Thanked by 3 users:
AiBs (01-13-2011), Artashes (01-13-2011), Gaz (01-12-2011)