I don’t see this header after submitting the form. Something might be happening before it is set —does sending the
This probably isn’t the cause of your immediate problem, but note that
Location headers must use a fully qualified URL.
header( 'Location: http://example.com/thanks.html' );
Relative paths might work in many cases, but it is less reliable and will not work at all in some browsers.
Also, please do not “dump” code on the forums. It is very difficult to read/navigate through and discourages people from trying to help. Small amounts of code necessary to describe a problem are fine, but make sure you use code blocks so they are properly formatted. If you need to share large amounts of code, use codepen or make a gist on github.