Please attach a copy of the page itself. I think the error may be lower on the page? Maybe it is in an include file.
I'd debug this by removing sections of the code until the error disappears. That will allow you to narrow down the error to a particular line of code and then it will become easier to look for the problem once you have the line narrowed down.