It is a very good practice to separate your PHP code from your HTML layout. In other words, in your web page layout file, it should only contain HTML code, and no PHP code should be in there.
How's this possible, you may ask? Well, I will give you the exact code that I use for my websites. But first, let me just say that when I started programming in PHP/MySQL, I would go the lazy way of combining my logic (PHP) with layout (HTML). There are certain advantages and disadvantages for doing this.
The advantage of mixing logic with html is that it is simple and fast. You can output just about any html code (tables, text, paragraphs, links, etc.) with PHP's echo function. However, good programming practice is always separating presentation from logic.
Let me ask you this. If you wanted to change the way your webpage looks, to be specific, you wanted to change the layout of your website, and you have PHP code embedded in your HTML code, can you just freely use a WYSIWYG editorr to move the graphics around, merge tables, change the CSS layout freely without having to worry about messing up your PHP code?
Now you may be able to get away with an advanced HTML editor like Macromedia Dreamweaver, but if you use Microsoft Frontpage, good luck with changing your website layout containing PHP code. For this simple reason, it is enough to convince you that you should separate logic from presentation.
The way you separate logic from presentation would be to introduce your own HTML element/tag, then write a PHP parser that will go through your HTML file and replace your custom tags. Thus, you can simply use these custom tags to be inserted in your html file without havnig to worry about messing up any PHP code - because the PHP code will be all written in a PHP file!
Sounds simple? Stick around and I will post the code here for you to use. Please post a reply if you haven't heard back from me as I forget things easily =).