...

View Full Version : templates??



Potter_gold
10-31-2006, 06:01 PM
Hi

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.

Peter

homerUK
10-31-2006, 06:37 PM
yup...

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.

littlejones
11-01-2006, 09:14 AM
Are you sure that works, I thought the brackets were mandatory and it should look like this...




<?php

include("nav_bar.php");

?>


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.




<?php

include("includes/nav_bar.inc.php");

?>

marek_mar
11-01-2006, 09:45 AM
The brackets are not needed. include/require are not real functions.

Potter_gold
11-01-2006, 08:43 PM
Thanks a lot, i will give it a bash before i go on holiday!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum