php - Any problem with using includes for everything but page-specific content? -


I am developing a site that is quite light on the interface and most operate the database (reads and writes equal volume) . It's written in PHP, and I found the easiest way to create each page:

Page:

   Data Point 1 & lt; / Td> & Lt; Td> Data Point 2 & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> Data Point 3 & lt; / Td> & Lt; Td> Data Point 4 & lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt; & Lt ;? Php included ("footer.php"); ? & Gt;  

header- nav.php:

   & Lt; Title & gt; Welcome to & lt; / Title & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "property / style.css" /> & Lt; / Head & gt; & Lt ;? Php included ("db_connect.php"); ? & Gt; & Lt; Body & gt; & Lt; Div id = "wrapper" & gt; & Lt; H1 & gt; Welcome to & lt; / H1> & Lt; Ul id = "nav" & gt; & Lt; Li & gt; & Lt; A href = "index.php" & gt; Home & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "data.php" & gt; Data & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt;  

footer.php:

  & lt; / Div & gt; & Lt; / Body & gt; & Lt ;? Php mysql_close ($ dbc); ? & Gt; & Lt; / Html & gt;  

All of these pages by itself are not valid and may generate errors.

My question is: Is it an efficient and easy to maintain solution?

It seems that only one pair is included (one and one at the top) is understandable. Especially because the site is so light that I do not need a web framework & lt; Html & gt; & Lt; Head & gt; Feeling uncomfortable creating a page without starting with ... etc

This is definitely a good thing, I would recommend it a lot. In this way, if you have to change the header or anything, you can easily do it at once. And the time to read to kill the file system is not really a big concern, so I would say that it is definitely acceptable.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -