PHP include best practices question

Terys

New Member
I have been learning syntax for PHP and practicing it. I come from a .NET background so masterpages always made things pretty easy for me when it came to headers and footers. So far I have a mainHeader.php and mainFooter.php which have my head menu and my footer html. I created a mainBody.php and at the top I put \[code\]<?php include "mainHeader.php" ?>\[/code\]and for the footer I put \[code\]<?php include "mainFooter.php" ?>\[/code\]This worked perfectly and made me smile because my pages all came together nicely. the mainHeader has my \[code\]<html>\[/code\] and \[code\]<body>\[/code\] and my mainFooter has my closing tags for those. Is this good practice?
 
Back
Top