First of all, create a PHP file with this :
phpinfo();
Then in the "PHP Variables" section, try to find the variable that could give you the current path to your file...
Now, in your form, add a name to the submit button... let's say... submit (how original !) (name="submit")...
In your script, if submit is set, that means the form has been sent, so check if submit is set. If it is set, verify the form, otherwise, if not set, simply show the form...
Now, you need to convert my words to PHP code. Good luck 🙂