I'm really confused as to what error you are encountering...
At the top, you're saying that the application is “hanging” -- what is hanging? The browser? Does it crash? Does PHP crash (e.g. you get a segfault)? Do javascript events stop working altogether on the page?
Then I ask you to comment out the ob_start stuff, and then you post HTML of a form.
So what's the issue then?
I'm really confused as to (1) what you're trying to do on the page, (2) what your expected behavior is, and (3) what the actual behavior is.
I know that you're feeling frustrated with this issue that you're encountering -- but please understand that in order for others to help you with your issue, it would really help if you could be a lot more clear in your questions and in describing the issue at hand.
Unfortunately, simply posting a link to your entire codebase or an entire listing of a file makes it very difficult for anyone to help you debug the issue or problem...
Bottom line: Folks do want to help... and the easier you make it for others to help you, the better.