You have to understand you cannot perform PHP function from HTML.
Anything interactive, such as a form submit button is done on the client side.
PHP is a server side language. Meaning the server will handle the PHP file, your computer never sees the PHP, it only sees what the HTML the server spit out to it.
Because then your computer never sees the PHP and the server doesnt read the HTML once its on your machine those two cannot interact.
That is until AJAX
So it works as a bridge between you the client and the server