You can’t pass data from HTML to a program directly, you would normally submit a form to a URI and configure the webserver to pass the submitted data to a program and the program’s output back to the webbrowser.
There are several common ways to do this
solved HTML- pass data to perl script [closed]