I updated the queryobj.php file to add an attribute:
$this->JavascriptRedirect = true;
This will make it use a javascript redirect instead of a php redirect.
Since you have your code added in the middle of html, it can't redirect using php. The javascript redirect option appears to have resolved this issue.