Online Programz

Daily Archives : September 7th, 2009

Broad Steps Of CGI Process

  • Browser shows the document containing the form.
  • User enters the data into form and click submit button.
  • Script in browser will perform client side validation.
  • Browser decodes URL and contacts server.
  • Server translates the URL into a path and a file name.
  • Server realizes that URL point to a program.
  • Server prepares its environment variables and launch the scripts.
  • Script executes and reads environment variables and STDIN.
  • script sends appropriate MIME header to STDOUT for content.
  • Server send rest of its output to STDOUT and terminates.
  • Server will notify the termination of script and closes the connection to browser.
  • Browser displays the output from the script.

CGI normally resides in a directory called CGI-bin.

When a script is invoked by a server, the server passes the information to script via environment variables.