PDA

Click to See Complete Forum and Search --> : to include or not to include


nabeels786
Nov 28th, 2002, 07:24 PM
Hello all,

I'm currently using a Dreamweaver template for my site, so the header is about 50 lines, and the footer about 50 too.

I was wondering, is it better (ie, uses less bandwidth) to include the header/footer in instead of have the html code repeat each time?

I know it makes it more readable, but other than that, is there an advantage?


<my header code>
...
<my php code>
...
<my footer code>


///or

include("path/to/header");
<my php code>
include("path/to/footer");


Thanks :)

The Hobo
Nov 28th, 2002, 08:16 PM
I'd throw my vote to use include. It's just much easier on you. It doesn't use any more bandwidth, but it could slow load time down. Yet, even on dialup, it'd probably not be noticable.

I've never had a problem doing it.

da_silvy
Nov 29th, 2002, 08:04 AM
it's just another file the server has to get

also, it means you change 1 file for changes to your header and footer, instead of many :)

nabeels786
Nov 29th, 2002, 08:39 AM
I decided not to use it, like da_silvy said, its another file the server has to process. Updating templates isn't a problem, since I won't be changing the design. Besides, Dreamweaver automatically updates all the sites's pages if you change the template

dpendley
Dec 10th, 2002, 05:14 AM
If the header and footer are the same for ever page then i would stick them in a js and include them from there.