Php

design

#1

I don’t know much about PHP, but I just want to know every’s opinion on an idea I have for keeping webpages easy updatable. At the moment, I have a header and a footer which is identical. I am using style sheets for layout (I refuse to use frames!!!), and I wondering if this idea I have will work. I’m going to demonstrate what I mean in rough pseudocode, since I don’t really know the PHP syntax:


include (I think this is a function in PHP?) headerfile.php

write code for the individual page here

include footer.php

My idea is that then if I want to change the content of the footer, I only need to change one file. Is this a good web design? It seems really simple to me, and I haven’t heard of it being done (not to say it’s not done like this). Is there a better solution that I should be aware of?


If we can send a man to the moon, why can’t we send them all there?


#2

[quote]include (I think this is a function in PHP?) headerfile.php

write code for the individual page here

include footer.php[/quote]
To answer your question, yes it can be done.

Wouldn’t necessarily have to include two files - just one. You could put the header and footer in the file to be included, and then just reference the data as necessary:

[code]include(’[path]/template.php’);

echo $template_header;

write code for the individual page here

echo $template_footer;[/code]

:cool: Perl / MySQL / HTML+CSS


#3

thanks for that!!!

The only other question is, is this the way the experts do it?


If we can send a man to the moon, why can’t we send them all there?


#4

what are they?


If we can send a man to the moon, why can’t we send them all there?