When you include any code samples in your posts, please wrap them with a [b][ PHP][/b] (no spaces) tag at the start of the code and a [b][/code][/b] tag at the end. This will then display your code with colored syntax highlighting as well as maintaining your indents, making it much easier for the rest of us to read and analyze your code.