most likely it is a probelm with PHP errors, but error reporting is turned off.
at lines 46 - 48:
?>
<?php
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:
<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?>
and see this post for details on the headers already sent error which occurs as a result of blank space between php tags:
showthread.php?t=19285