Many WEB pages are static. You request the page, the page is served. Period. We want to be able to have the user interact with the page, in particular to have the server execute a program and return its output.
Pretend for now that we have that program written and it's on our server, and lets say that it's called ``hello.pl''. It sits inside a directory called cgi-bin in your public_html directory structure.
Here's how we put a link inside the WEB page to execute the program.
<HTML> <BODY> Can you see me? <P> Do you want to execute me? <FORM METHOD=GET ACTION="http://www-stat.wharton.upenn.edu/~waterman/cgi-bin/hello.pl" > <INPUT TYPE="SUBMIT" VALUE="YES"> </FORM> </BODY> </HTML>
What happens?
The action is in the FORM tag. The WEB page initiates a GET request which is sent to the server. The server recognizes the object of the GET request as an executable program (because of the .pl) extension. The server executes the program and returns the output from the program to the browser.
If you think of the client/server interaction as an ``ASK/RECEIVE'' pair, then this page simply allows the client to ask for the output from a program.