This question already has an answer here:
I have an HTML form that will be used on many webpages, so I want to use an external file for PHP rather than adding the PHP to each HTML page. I have one question:
How can I make it so when the "submit" button in an HTML form is clicked, a function (or the whole code) from an external PHP file will run?
</div>
<form action="your_php_file.php" method="post">
.. your stuff ..
</form>