You have to understand you cannot perform PHP function from HTML.
When you look at a website on your computer, everything you are looking at is actually on YOUR computer. The HTML/Javascript and Imagery is all downloaded form the server to the client (meaning YOU) That is why HTML and Javascripting is called a Client side language, because it is executed by the user (client (meaning you))
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
AJAX is not a language, it is basically a method in Javascript to send and recieve things from the server without leaving the client side area, or refreshign the page.
So it works as a bridge between you the client and the server