Reply to Re: Avoiding Duplicating Code

Your name:

Reply:


Posted by password on 11/14/06 23:31

"Robb" <robbDELETE@DELETEtarus.com> wrote in message
news:auakl2dej4fvagkvh8c80f103hlm38s9kg@4ax.com...
> My header (images and a couple links), main menu, and footer are the same
on all pages. Can they be
> put into an external file instead of duplicated on every page?
>
php and includes

make main content bit a php file
make your header menu etc a separate html file
make footer a separate html file

then at top and bottom of php page do

<?php
include('whereeveritis/header.html');
?>

php content stuff goes here
<?php
include('whereeveritis/footer.html');
?>

'whereveritis' is the route to the html files
you may have to fiddle with route to your css because the 'includes' think
(behave as if) they are where the php page is located even if they are in a
different folder

i hope that is clear

[Back to original 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

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