To add to "Your Common Sense" answer:
I would suggest that the next step would be to separate your HTML and PHP code.
i.e. moving out the logic for account closure into its own class since you might want to use that logic elsewhere. (DRY Principle)
It's best to let JS/HTML handle redirects too since that is something related to the front end ...
The code is overall good basic PHP and above the average. However, I would like it more structured.
For example, why you are setting the error reporting manually in this file? Apparently you have sort of a bootstrap file as includes/header.php, why not to put these lines there?
Besides, i don't see any point in the line assigning $post_id variable. What does ...