I have a Python script a.py
that prompts for a URL:
url = input(\'URL: \')
It uses modules to check headers for URL validity,
There are a couple of ways to achieve this. You could use Apache modules like mod_python or mod_wsgi (which adheres to wsgi python standard), you could use a cgi script or you can use PHP (which is fairly common in web environments) to execute the python script through exec or system function.
I think the easiest one would be just use PHP.
exec('python /path/to/file.py');
Edit: I just realized that my solution only describes how to run the python script.
You could pass the url input through an argument on python.
$url = $_GET['url'];
exec("python /path/to/file.py $url");
This is potentially dangerous even with user input validation.
To execute it through a button, you could do an AJAX call. (jQuery example)
$('#button').on('click', function() {
$.get('python.php', {url : 'url' });
});