In the future please attach pages rather than copy/paste their contents so I can open them with Dreamweaver to debug more efficiently.
I think your issue will be solved by updating your form action from:
<form action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"
to:
<form action=""