just keep this in mind: if you use
if (isset($_POST['submit']))
make sure your submit button looks like this:
<input type="submit" name="submit" value="Submit This form">
Where the name attribute is given and matches what you use with the isset() function. Also on your form action, to have php dynamically assign the script name to the form when it is submitted (so the form submits to the same page), you can use $PHP_SELF
<form method="post" action="<?= $PHP_SELF ?>">
Cgraz