Home
 
 
 
  How to Get Information from the Server Using CGI

Now we will discuss how the CGI program helps to get the data or information from sever. If you are client and send the request to the URL under the CGI program, the server immediately executes your request. And the output of this request is transmitted to you (the client). Here, you have to remember that you can not send options of command-line or arguments to the program. But there is a misconception prevails about it that as a client you can send such things to your program. It is wrong. Remember, CGI does not use command-line for this purpose. Therefore, it is not possible directly; however you have to use it a round about way. What actually CGI does; the environment variables are used by the CGI to send the program of the clients. Now a natural question arises in your mind, what are the environmental variables that are used for this purpose?

The two important variables of environment that are used are QUERY_STYRING and PATH_INFO. The QUERY_STRING is anything that comes first to the URL. This is done generally using HTML form. This can be also done manually with the help of HTML anchor text. Actually this string of information works as an information query. That means it gives information about the required data of the user and on the basis of this information search is made in the data base to get the result. In this way the user gets back the data of his necessity. The second environmental variable is PATH_INFO. It is used to get extra information. Using this variable CGI transmits some extra data or information to the CGI script. This simply transmits the file locations to the Common Gateway Interface program.

 
 
 
  Category Listings

An Introduction of CGI (Common Gateway Interface)
An Overview of CGI
The Specifics of CGI Program
Implementation of CGI
What Common Gateway Interface (CGI) is?
The Common Uses of CGI
How CGI Routine Works?
Fast CGI; A Variation of the Original Form
Things to Remember While Using CGI
Uses of CGI Scripts
Advantages and Disadvantages of CGI Script
Flash and CGI
How to Get Information from the Server Using CGI
How to Send the Document Back to the Client
CGI Unlocks Back-end Application