In order to post form data to a php file, is it necessary that the file which contains the code for the form also needs to be a .php file or it could also be a .html file?
The form itself can be in a .html file, however the receiving file cannot be .html and in your case sounds like it should be a .php. If it is redirecting to itself then it must be a .php file.
You set the recieving file like so:
<form action="processform.php" method="POST">