Not a hugely clear question but here goes...
I am assuming you have a CSS file with the layout for your various divs?
If you have a different file for each of your content pages, you could do something like this....
index.php
Code: Select all
<?php
include("header.php");
include("menu.php");
//calling your content depending on the url variable pageid
if (isset($_GET['pageid'])){
switch ($_GET['pageid']) {
case 1:
include("content1.php");
break;
case 2:
include("content2.php");
break;
case 3:
include ("content3.php");
break;
default:
include("content1.php"); // this stops pageid to be set by the user trying to break your script
}
}
else {
include ("content1.php"); //this one allows for just index.php to get default page
}
include("footer.php");
?>
Then you make...
content1.php with the content for page 1
content2.php with the content for page 2
etc
Your pages are called by the menu with urls like
index.php - which yanks up content1.php as the content
index.php?pageid=1 for content 1
index.php?pageid=2 for content 2
index.php?pageid=3 for content 3...
You could use this kind of layout to pull the page contents from a database!
Each of your include files contains the <div id=foo>Bar</div> etc
The header.php includes doctype, head, body tags
and the footer.php closes off the html
Hope that helps