Oh, yes, I neglected to mention one thing... Make sure you enclose your PHP code in PHP tags, like this:
Some people like to take short-cuts with the PHP tags and use them this way:
I don't take that short-cut, because it doesn't always work the way you think it should.