Ok, I have a question about making efficient webpages. I was recently part of a team that made a web application (mainly php/mysql) and one technique we used to make the code more readable was to use include statements. We put the header of footer of the pages in another file and included them. We did the same thing with other parts.
This makes the code more readable (shorter) and helped us make changes that immediately effective across the whole site.
I am now looking at doing another project that may have more users and I was wondering if this technique of using includes was a good one. Again, it will be a php/mysql application. If you have any insight into this topic that would be great.
another thing you could do, if you have not done so, is to separate the coding from html, ie. you have template files with only html and files with only php. This can surely help you maintain and update your site - the designer of the site:
- the designer can work on the templates and does not need to know what you are coding.
- similarly, you can do all the coding without worrying about the artistic side.
I highly doubt includes are really going to affect the performance of your script that heavily at all. You could research every construct in PHP, but PHP is meant to make web programming easy; it's no assembly.
I agree with orbitz about templating; I personally use Smarty for templating, and it works great. That's much slower than just using includes though.