Front end posting, not working wp_redirect with ‘cannot modify header information’ error

Lines like this one can cause trouble: if ($_FILES) {. If $_FILES is not set and you try to use it in a conditional like that, you will get a Notice and if debugging is on that notice will print to the screen. I am guessing that is what is happening.

You should check variables with isset or empty, the way you do in a number of other places, and never use a bare variable as if it were a boolean.

Also, you are also returning from what appears to be global scope. When I try that, I get bool(false) printed to the screen. That could cause this issue as well.