You are here: Re: php includes « All PHP « IT news, forums, messages
Re: php includes

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация