Forum Moderators: coopster
1. Copy and paste the following into a text editor.
<html>
<head><title>My Homepage</title>
</head><body>
<table cellpadding=3 cellspacing=3 width=100%>
<tr>
<td>
<p><a href="index.php?cmd=page1">Page One</a></p>
<p><a href="index.php?cmd=page2">Page One</a></p>
<p><a href="index.php?cmd=page3">Page One</a></p>
</td>
<td>
<!-- Load Template -->
<p><b>You have just loaded page One.</b></p>
<!-- Load Template -->
</td>
</tr>
</table>
</body>
</html>
2. Go into your code and seperate the code into 3 areas and save each with a .php extension.
So, save the following as 'header.php'
<html>
<head><title>My Homepage</title>
</head><body>
<table cellpadding=3 cellspacing=3 width=100%>
<tr>
<td>
<p><a href="index.php?cmd=page1">Page One</a></p>
<p><a href="index.php?cmd=page2">Page One</a></p>
<p><a href="index.php?cmd=page3">Page One</a></p>
</td>
<td>
<!-- Load Template -->
The following as 'footer.php'
<!-- Load Template -->
</td>
</tr>
</table>
</body>
</html>
and the following as 'page1.php'
<p><b>You have just loaded page One.</b></p>
3. Next do 2 'save as' and duplicate your 'page1.php' and call them 'page2.php' and 'page3.php'. So you have now have 5 files. On your page 2 and 3, type You have just loaded page Two and You have just loaded page Three respectively.
4. Next, create a new page and call it 'index.php'. On that page, add the following:
<?php$cmd = $_GET['cmd'];
@include('header.php');
switch($cmd)
{case "page1":
@include('page1.php');
break;case "page2":
@include('page2.php');
break;case "page3":
@include('page3.php');
break;}
@include('footer.php');?>
Finally upload the files to your server and access your index.php page in your browser. When you click each link it should load the appropriate template.
Hope that helps you understand how it works.
dc
:)