most likely it is a probelm with PHP errors, but error reporting is turned off.
at lines 46 - 48:
the space between php code blocks is enough to break the redirect.
delete that blank line at line 47.
if you still have problems, add the following code at line 1 of the page to turn error reporting on:
and see this post for details on the headers already sent error which occurs as a result of blank space between php tags: