The redirect isn't working because you have already printed a webpage.
When you redirect you must print the redirect header as
the only output of the script and then exit with no other output.
You should either print the form OR call the submit_parameters function.