When you get this message it is usually because of some white space that is outside of the php block. It looks like this output is occurring on line 3, look around this line for any spaces, tabs or anything like that outside of the php blocks and delete it.
This should at least get you able to run this code. I'm not sure it the code will solve the problem you are experiencing though.