in reply to Redirection question

If you are redirecting, then you aren't printing out any table. Only output the Content-type: header when you need to (i.e., when you're printing the table)