Posted by Nick on 11/24/05 17:56
Moziah wrote:
> Probably a simpe question with a simple answer. I have a page with a menu
> and an include which contains the content of the page. Is it possible to
> click a link on the menu and have the include bring up a different file?
Rather than have a file with the menu which includes the content, it is
usually a lot easier to have it the other way round - each page includes
a header and a footer, containing the code surrounding the page. Such as
info.php:
-----------
<? include('header.php'); //menu stuff in here ?>
<h1>Info</h1>
<p>This is the info page</p>
<? include('footer.php'); ?>
------------
That should achieve what you want. Then your menu can just link directly
to info.php and any of the other pages you have The header.php would
contain the opening <html> and <body>, and your menu. the footer.php
would have closing tags like </body></html>.
Navigation:
[Reply to this message]
|