Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: CGI program

by manishrathi (Beadle)
on Sep 23, 2009 at 17:49 UTC ( [id://797043]=note: print w/replies, xml ) Need Help??


in reply to Re: CGI program
in thread CGI program

AUTH_TYPE
CONTENT_LENGTH
CONTENT_TYPE
GATEWAY_INTERFACE
PATH_INFO
PATH_TRANSLATED
QUERY_STRING
REMOTE_ADDR
REMOTE_HOST
REMOTE_IDENT
REMOTE_USER
REQUEST_METHOD
SCRIPT_NAME
SERVER_NAME
SERVER_PORT
SERVER_PROTOCOL
SERVER_SOFTWARE
Are these variables part of web server or are they defined by CGI ? I am um=nder thye impression that these varibles are defined as environment variables by the web server environment.
AM I correct , or are these variables specified by the CGI only and when a CGI is used in a program , only at thah time these variables can be used in a program ? If these variables are specified by the web server, then why can they not be used in the script directly ? Why do we have to use CGI to get these values in the script ? thanks

Replies are listed 'Best First'.
Re^3: CGI program
by moritz (Cardinal) on Sep 23, 2009 at 18:12 UTC

    The CGI specification requires the web server to set these environment variables. The script is then free to do with these variables what it wants.

    You don't need to use the module CGI.pm to access these variables, but it provides a convenient way to do it.

    Perl 6 - links to (nearly) everything that is Perl 6.
      Are these variables created by web server, irrespective of whether CGI API is used in a script or not or are they created only when CGI API is used by a script ?
      These variable get their names only after they web server creates them and assigns values. But how are they named , when they are received by the webserver ? For example, will QUERY_STRING have different name before its named by web server ?
        The web server has a configuration file which tells it if a certain program is to be run as a CGI script or not. If the answer is "yes", the web server sets up all these variables before calling the script.
        For example, will QUERY_STRING have different name before its named by web server ?

        The web server likely has an internal data structure that holds that information - it doesn't matter how that thing is called.

        Perl 6 - links to (nearly) everything that is Perl 6.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://797043]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (1)
As of 2024-04-24 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found