All PHP scripts begin with '<?php' and end with '?>'. When set within a page of HTML , these indicators tell the computer where to differentiate between HTML and PHP.
The next line is a PHP statement that does three things. It takes the form data from the web page and forms a terminal command, a system call, from it, passing the form data to the Python program as a command line argument. The trailing '3' is simply the second argument for the Python program, sys.argv[2]. Where CGI requires a bit of hacking to handle multiple options, PHP allows you to hardwire options into the script, thus allowing you to call the same script in different ways from various pages.
This system call is then executed using the PHP command 'shell_exec()', which runs the Python program and returns the output. This output is then assigned to the variable '$results'. It is important to note that variables in PHP start with a dollar sign ('$') and that all PHP statements must end with a semi-colon (';').
