[eluser]Twisted1919[/eluser]
Do you have $config['compress_output'] = TRUE ; in your config file ? If so, then that's the problem, don't echo anything with compression active .
What's the part where your script dies , when you submit valid data ? or when you submit invalid data ?
P.S: Follow the user guide to indent your code, provided sample sucks .