Yes you can reuse the exact code...
basically what you need to do is take all of your header code and place it in a separate file (eg. header.php). Then you will go to where the header code originally was and replace it with an include statement to that file.
<? include("header.php"); ?> (use the question mark brackets to show where php code starts and ends)
so for example, if this is what you originally had:
PHP Code:
index.php
<header code>blah blah blah blah</header code>
<navigation code>more blah blah blah</navigation code>
<body code>this is the main body of the page</body code>
<just some other code>1 2 3 4 5</just some other code>
you will then change it to this:
PHP Code:
header.php
<header code>blah blah blah blah</header code>
navigation.php
<navigation code>more blah blah blah</navigation code>
index.php
<?
include("header.php");
include("navigation.php");
?>
<body code>this is the main body of the page</body code>
<just some other code>1 2 3 4 5</just some other code>
i hope that made sense. remember that pages that you use to include the php must have a php extension.
Bookmarks