You never named your submit button, so as far as the form is concerned it's just an action.
Either:
<input type="submit" name="submit" ... />
)if (!empty($_POST))
instead to detect when data has been posted.Remember that keys in the $_POST
superglobal only appear for named input elements. So, unless the element has the name attribute, it won't come through to $_POST
(or $_GET
/$_REQUEST
)