View Full Version : templates??
10-31-2006, 05:01 PM
Each time i create a new part on my NAV Bars i need to copy and paste it throughout each individual page i create. Is PHP the answer to this?
Can i have it so i only maintain a NAV BAR in one place and it to automatically update on all pages.
Many thanks in advance for your help.
10-31-2006, 05:37 PM
create a page and save it as "nav_bar.php" (or what ever) and in each of your pages, where you want the bar to appear put
<?php include "nav_bar.php"; ?>
that way you only update on file which is included on all the pages.
11-01-2006, 08:14 AM
Are you sure that works, I thought the brackets were mandatory and it should look like this...
I would also name the included files you use .inc.php and put them all in an includes folder and refer to them as shown below. It's totally optional is a good way to organise files that have numerous dependancies.
11-01-2006, 08:45 AM
The brackets are not needed. include/require are not real functions.
11-01-2006, 07:43 PM
Thanks a lot, i will give it a bash before i go on holiday!!
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.